com.sleepycat.je.recovery
Class RecoveryManager

java.lang.Object
  extended by com.sleepycat.je.recovery.RecoveryManager

public class RecoveryManager
extends Object


Constructor Summary
RecoveryManager(EnvironmentImpl env)
          Make a recovery manager
 
Method Summary
 RecoveryInfo recover(boolean readOnly)
          Look for an existing log and use it to create an in memory structure for accessing existing databases.
static void traceRootDeletion(Level level, DatabaseImpl database)
          Log trace information about root deletions, called by INCompressor and recovery.
static void undo(Level traceLevel, DatabaseImpl db, TreeLocation location, LN lnFromLog, byte[] mainKey, byte[] dupKey, long logLsn, long abortLsn, boolean abortKnownDeleted, RecoveryInfo info, boolean splitsAllowed)
          Undo the changes to this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecoveryManager

public RecoveryManager(EnvironmentImpl env)
                throws DatabaseException
Make a recovery manager

Throws:
DatabaseException
Method Detail

recover

public RecoveryInfo recover(boolean readOnly)
                     throws DatabaseException
Look for an existing log and use it to create an in memory structure for accessing existing databases. The file manager and logging system are only available after recovery.

Returns:
RecoveryInfo statistics about the recovery process.
Throws:
DatabaseException

undo

public static void undo(Level traceLevel,
                        DatabaseImpl db,
                        TreeLocation location,
                        LN lnFromLog,
                        byte[] mainKey,
                        byte[] dupKey,
                        long logLsn,
                        long abortLsn,
                        boolean abortKnownDeleted,
                        RecoveryInfo info,
                        boolean splitsAllowed)
                 throws DatabaseException
Undo the changes to this node. Here are the rules that govern the action taken.

 found LN in  | abortLsn is | logLsn ==       | action taken
    tree      | null        | LSN in tree     | by undo
 -------------+-------------+----------------------------------------
      Y       |     N       |      Y          | replace w/abort LSN
 ------------ +-------------+-----------------+-----------------------
      Y       |     Y       |      Y          | remove from tree
 ------------ +-------------+-----------------+-----------------------
      Y       |     N/A     |      N          | no action
 ------------ +-------------+-----------------+-----------------------
      N       |     N/A     |    N/A          | no action (*)
 (*) If this key is not present in the tree, this record doesn't
 reflect the IN state of the tree and this log entry is not applicable.

 

Parameters:
location - holds state about the search in the tree. Passed in from the recovery manager to reduce objection creation overhead.
lnFromLog - - the new node to put in the tree.
mainKey - is the key that navigates us through the main tree
dupTreeKey - is the key that navigates us through the duplicate tree
logLsn - is the LSN from the just-read log entry
abortLsn - gives us the location of the original version of the node
info - is a recovery stats object.
Throws:
DatabaseException

traceRootDeletion

public static void traceRootDeletion(Level level,
                                     DatabaseImpl database)
Log trace information about root deletions, called by INCompressor and recovery.



Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.