public RecoveryInfo recover(boolean readOnly)
throws DatabaseException {
startupTracker.start(Phase.TOTAL_RECOVERY);
try {
FileManager fileManager = envImpl.getFileManager();
DbConfigManager configManager = envImpl.getConfigManager();
boolean forceCheckpoint =
configManager.getBoolean
(EnvironmentParams.ENV_RECOVERY_FORCE_CHECKPOINT);
if (fileManager.filesExist()) {
/*
* Check whether log files are correctly located in the sub
* directories.
*/
fileManager.getAllFileNumbers();
/*
* Establish the location of the end of the log. Log this
* information to the java.util.logging logger, but delay
* tracing this information in the .jdb file, because the
* logging system is not yet initialized. Because of that, be
* sure to use lazy logging, and do not use
* LoggerUtils.logAndTrace().
*/
findEndOfLog(readOnly);
String endOfLogMsg = "Recovery underway, found end of log";
Trace.traceLazily(envImpl, endOfLogMsg);
/*
* Establish the location of the root, the last checkpoint, and
* the first active LSN by finding the last checkpoint.
*/
findLastCheckpoint();
envImpl.getLogManager().setLastLsnAtRecovery
(fileManager.getLastUsedLsn());
/* Read in the root. */
envImpl.readMapTreeFromLog(info.useRootLsn);
/* Build the in memory tree from the log. */