public boolean verify(PrintStream out)
throws DatabaseException {
boolean ret = true;
try {
VerifyConfig verifyConfig = new VerifyConfig();
verifyConfig.setPrintInfo(!quiet);
if (progressInterval > 0) {
verifyConfig.setShowProgressInterval(progressInterval);
verifyConfig.setShowProgressStream(out);
}
openEnv();
EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
Tracer.trace(Level.INFO, envImpl,
"DbVerify.verify of " + dbName + " starting");
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setReadOnly(true);
dbConfig.setAllowCreate(false);
DbInternal.setUseExistingConfig(dbConfig, true);
Database db = env.openDatabase(null, dbName, dbConfig);
try {
if (checkLsns) {
System.out.println("Checking obsolete offsets ...");
VerifyUtils.checkLsns(db);
} else {
/* Use DatabaseImpl.verify so we can get a status
return. */
DatabaseImpl dbImpl = DbInternal.dbGetDatabaseImpl(db);
DatabaseStats stats = dbImpl.getEmptyStats();
ret = dbImpl.verify(verifyConfig, stats);
if (verifyConfig.getPrintInfo()) {
out.println(stats);
}
}
} finally {
if (db != null) {