public static String formatTime(long seconds, boolean withPrefix) { int minLen = withPrefix ? 12 : 0; return formatTime(seconds, minLen); }
public static String formatTime(long seconds, boolean withPrefix) { int minLen = withPrefix ? 12 : 0; return formatTime(seconds, minLen); }
protected void dropIndexes() throws DataAccessException { System.out.println("dropping indexes"); long start = System.currentTimeMillis(); datasource.dropForeignKeyConstraint(null, "FK_CERT_ISSUER1", "CERT"); datasource.dropUniqueConstrain(null, "CONST_ISSUER_SN", "CERT"); datasource.dropPrimaryKey(null, "PK_CERT", "CERT"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" dropped indexes in " + StringUtil.formatTime(duration, false)); }
protected void recoverIndexes() throws DataAccessException { System.out.println("recovering indexes"); long start = System.currentTimeMillis(); datasource.addPrimaryKey(null, "PK_CERT", "CERT", "ID"); datasource.addForeignKeyConstraint(null, "FK_CERT_ISSUER1", "CERT", "IID", "ISSUER", "ID", "CASCADE", "NO ACTION"); datasource.addUniqueConstrain(null, "CONST_ISSUER_SN", "CERT", "IID", "SN"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" recovered indexes in " + StringUtil.formatTime(duration, false)); }
protected void dropIndexes() throws DataAccessException { System.out.println("dropping indexes"); long start = System.currentTimeMillis(); datasource.dropForeignKeyConstraint(null, "FK_CERT_ISSUER1", "CERT"); datasource.dropUniqueConstrain(null, "CONST_ISSUER_SN", "CERT"); datasource.dropPrimaryKey(null, "PK_CERT", "CERT"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" dropped indexes in " + StringUtil.formatTime(duration, false)); }
protected void recoverIndexes() throws DataAccessException { System.out.println("recovering indexes"); long start = System.currentTimeMillis(); datasource.addPrimaryKey(null, "PK_CERT", "CERT", "ID"); datasource.addForeignKeyConstraint(null, "FK_CERT_ISSUER1", "CERT", "IID", "ISSUER", "ID", "CASCADE", "NO ACTION"); datasource.addUniqueConstrain(null, "CONST_ISSUER_SN", "CERT", "IID", "SN"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" recovered indexes in " + StringUtil.formatTime(duration, false)); }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); try { // CertStore OcspCertstoreDbExporter certStoreExporter = new OcspCertstoreDbExporter(datasource, destFolder, numCertsInBundle, numCertsPerSelect, resume, stopMe); certStoreExporter.export(); certStoreExporter.close(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); // CertStore try { OcspCertStoreFromCaDbImporter certStoreImporter = new OcspCertStoreFromCaDbImporter( datasource, srcFolder, publisherName, batchEntriesPerCommit, resume, stopMe); certStoreImporter.importToDb(); certStoreImporter.shutdown(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); // CertStore try { OcspCertstoreDbImporter certStoreImporter = new OcspCertstoreDbImporter(datasource, srcFolder, batchEntriesPerCommit, resume, stopMe); certStoreImporter.importToDb(); certStoreImporter.close(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); // CertStore try { OcspCertStoreFromCaDbImporter certStoreImporter = new OcspCertStoreFromCaDbImporter( datasource, srcFolder, publisherName, batchEntriesPerCommit, resume, stopMe); certStoreImporter.importToDb(); certStoreImporter.close(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); // CertStore try { OcspCertstoreDbImporter certStoreImporter = new OcspCertstoreDbImporter(datasource, srcFolder, batchEntriesPerCommit, resume, stopMe); certStoreImporter.importToDb(); certStoreImporter.shutdown(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); try { // CertStore OcspCertstoreDbExporter certStoreExporter = new OcspCertstoreDbExporter(datasource, destFolder, numCertsInBundle, numCertsPerSelect, resume, stopMe); certStoreExporter.export(); certStoreExporter.shutdown(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); try { DigestDiff diff = new DigestDiff(refDatasource, targetDatasource, reportDir, revokedOnly, stopMe, numCertsPerSelect, numThreads); diff.setIncludeCaCerts(includeCaCerts); diff.diff(); } finally { try { refDatasource.close(); } catch (Throwable th) { LOG.error("refDatasource.close()", th); } try { targetDatasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("finished in " + StringUtil.formatTime((end - start) / 1000, false)); } } // method run0
protected void printSummary() { processLog.printTrailer(); String averageText = StringUtil.formatAccount(processLog.totalAverageSpeed(), 1); String msg = StringUtil.concatObjectsCap(400, " started at: ", new Date(processLog.startTimeMs()), "\nfinished at: ", new Date(processLog.endTimeMs()), "\n duration: ", StringUtil.formatTime(processLog.totalElapsedTime() / 1000, false), "\n account: ", StringUtil.formatAccount(processLog.numProcessed(), 1), " ", unit, "\n failed: ", StringUtil.formatAccount(errorAccount.get(), 1), " ", unit, "\n average: ", averageText, " ", unit, "/s\n"); System.out.println(msg); }
protected void printSummary() { processLog.printTrailer(); String averageText = StringUtil.formatAccount(processLog.totalAverageSpeed(), 1); String msg = StringUtil.concatObjectsCap(400, " started at: ", new Date(processLog.startTimeMs()), "\nfinished at: ", new Date(processLog.endTimeMs()), "\n duration: ", StringUtil.formatTime(processLog.totalElapsedTime() / 1000, false), "\n account: ", StringUtil.formatAccount(processLog.numProcessed(), 1), " ", unit, "\n failed: ", StringUtil.formatAccount(errorAccount.get(), 1), " ", unit, "\n average: ", averageText, " ", unit, "/s\n"); System.out.println(msg); }
@Override protected void run0() throws Exception { long start = System.currentTimeMillis(); try { if (!resume) { // CAConfiguration CaconfDbExporter caConfExporter = new CaconfDbExporter(datasource, destFolder, stopMe); caConfExporter.export(); caConfExporter.close(); } // CertStore CaCertstoreDbExporter certStoreExporter = new CaCertstoreDbExporter(datasource, destFolder, numCertsInBundle, numCertsPerSelect, resume, stopMe); certStoreExporter.export(); certStoreExporter.close(); } finally { try { datasource.close(); } catch (Throwable th) { LOG.error("datasource.close()", th); } long end = System.currentTimeMillis(); System.out.println("Finished in " + StringUtil.formatTime((end - start) / 1000, false)); } } // method run0
private void dropIndexes() throws DataAccessException { long start = System.currentTimeMillis(); datasource.dropIndex(null, "CERT", "IDX_CA_FPK"); datasource.dropIndex(null, "CERT", "IDX_CA_FPS"); datasource.dropIndex(null, "CERT", "IDX_CA_FPRS"); datasource.dropForeignKeyConstraint(null, "FK_CERT_CA1", "CERT"); datasource.dropForeignKeyConstraint(null, "FK_CERT_USER1", "CERT"); datasource.dropUniqueConstrain(null, "CONST_CA_SN", "CERT"); datasource.dropForeignKeyConstraint(null, "FK_PUBLISHQUEUE_CERT1", "PUBLISHQUEUE"); datasource.dropForeignKeyConstraint(null, "FK_REQCERT_REQ1", "REQCERT"); datasource.dropForeignKeyConstraint(null, "FK_REQCERT_CERT1", "REQCERT"); datasource.dropPrimaryKey(null, "PK_CERT", "CERT"); datasource.dropPrimaryKey(null, "PK_REQUEST", "REQUEST"); datasource.dropPrimaryKey(null, "PK_REQCERT", "REQCERT"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" dropped indexes in " + StringUtil.formatTime(duration, false)); }
private void dropIndexes() throws DataAccessException { long start = System.currentTimeMillis(); datasource.dropIndex(null, "CERT", "IDX_CA_FPK"); datasource.dropIndex(null, "CERT", "IDX_CA_FPS"); datasource.dropIndex(null, "CERT", "IDX_CA_FPRS"); datasource.dropForeignKeyConstraint(null, "FK_CERT_CA1", "CERT"); datasource.dropForeignKeyConstraint(null, "FK_CERT_USER1", "CERT"); datasource.dropUniqueConstrain(null, "CONST_CA_SN", "CERT"); datasource.dropForeignKeyConstraint(null, "FK_PUBLISHQUEUE_CERT1", "PUBLISHQUEUE"); datasource.dropForeignKeyConstraint(null, "FK_REQCERT_REQ1", "REQCERT"); datasource.dropForeignKeyConstraint(null, "FK_REQCERT_CERT1", "REQCERT"); datasource.dropPrimaryKey(null, "PK_CERT", "CERT"); datasource.dropPrimaryKey(null, "PK_REQUEST", "REQUEST"); datasource.dropPrimaryKey(null, "PK_REQCERT", "REQCERT"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" dropped indexes in " + StringUtil.formatTime(duration, false)); }
private void recoverIndexes() throws DataAccessException { long start = System.currentTimeMillis(); datasource.addPrimaryKey(null, "PK_CERT", "CERT", "ID"); datasource.addPrimaryKey(null, "PK_REQUEST", "REQUEST", "ID"); datasource.addPrimaryKey(null, "PK_REQCERT", "REQCERT", "ID"); datasource.addForeignKeyConstraint(null, "FK_PUBLISHQUEUE_CERT1", "PUBLISHQUEUE", "CID", "CERT", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_CERT_CA1", "CERT", "CA_ID", "CA", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_CERT_USER1", "CERT", "UID", "TUSER", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_REQCERT_REQ1", "REQCERT", "RID", "REQUEST", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_REQCERT_CERT1", "REQCERT", "CID", "CERT", "ID", "CASCADE", "NO ACTION"); datasource.addUniqueConstrain(null, "CONST_CA_SN", "CERT", "CA_ID", "SN"); datasource.createIndex(null, "IDX_CA_FPK", "CERT", "CA_ID", "FP_K"); datasource.createIndex(null, "IDX_CA_FPS", "CERT", "CA_ID", "FP_S"); datasource.createIndex(null, "IDX_CA_FPRS", "CERT", "CA_ID", "FP_RS"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" recovered indexes in " + StringUtil.formatTime(duration, false)); }
private void recoverIndexes() throws DataAccessException { long start = System.currentTimeMillis(); datasource.addPrimaryKey(null, "PK_CERT", "CERT", "ID"); datasource.addPrimaryKey(null, "PK_REQUEST", "REQUEST", "ID"); datasource.addPrimaryKey(null, "PK_REQCERT", "REQCERT", "ID"); datasource.addForeignKeyConstraint(null, "FK_PUBLISHQUEUE_CERT1", "PUBLISHQUEUE", "CID", "CERT", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_CERT_CA1", "CERT", "CA_ID", "CA", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_CERT_USER1", "CERT", "UID", "TUSER", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_REQCERT_REQ1", "REQCERT", "RID", "REQUEST", "ID", "CASCADE", "NO ACTION"); datasource.addForeignKeyConstraint(null, "FK_REQCERT_CERT1", "REQCERT", "CID", "CERT", "ID", "CASCADE", "NO ACTION"); datasource.addUniqueConstrain(null, "CONST_CA_SN", "CERT", "CA_ID", "SN"); datasource.createIndex(null, "IDX_CA_FPK", "CERT", "CA_ID", "FP_K"); datasource.createIndex(null, "IDX_CA_FPS", "CERT", "CA_ID", "FP_S"); datasource.createIndex(null, "IDX_CA_FPRS", "CERT", "CA_ID", "FP_RS"); long duration = (System.currentTimeMillis() - start) / 1000; System.out.println(" recovered indexes in " + StringUtil.formatTime(duration, false)); }