com.sleepycat.je.dbi
Class SortedLSNTreeWalker
java.lang.Object
com.sleepycat.je.dbi.SortedLSNTreeWalker
public class SortedLSNTreeWalker
- extends Object
Class to walk over the tree using sorted LSN fetching for parts of the tree
that are not in memory. Returns LSNs for each node in the tree
except the root IN, but in an arbitrary order (i.e. not key
order). The caller is responsible for getting the root IN's LSN explicitly.
A calllback function specified in the constructor is executed for each LSN
found.
The walker works in two phases. The first phase is to gather and return all
the INs from the INList that match the database being iterated over. For
each IN, all of the LSNs of the children are passed to the callback method
(processLSN). If the child was not in memory, it is added to a list of LSNs
to read. When all of the in-memory INs have been processed, the list of
LSNs that were harvested are sorted.
Then for each of the sorted LSNs, the target is fetched, the type
determined, and the LSN and type passed to the callback method for
processing. LSNs of the children of those nodes are retrieved and the
process repeated until there are no more nodes to be fetched for this
database's tree.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dbImpl
protected DatabaseImpl dbImpl
accumulateLNs
protected boolean accumulateLNs
SortedLSNTreeWalker
public SortedLSNTreeWalker(DatabaseImpl dbImpl,
boolean removeINsFromINList,
boolean setDbState,
long rootLsn,
SortedLSNTreeWalker.TreeNodeProcessor callback,
List savedExceptions)
throws DatabaseException
- Throws:
DatabaseException
walk
public void walk()
throws DatabaseException
- Find all non-resident nodes, and execute the callback. The root IN's
LSN is not returned to the callback.
- Throws:
DatabaseException
walkInternal
protected void walkInternal()
throws DatabaseException
- Throws:
DatabaseException
getRootIN
protected IN getRootIN(long rootLsn)
throws DatabaseException
- The default behavior fetches the rootIN from the log, but classes
extending this may fetch the root from the tree.
- Throws:
DatabaseException
releaseRootIN
protected void releaseRootIN(IN ignore)
throws DatabaseException
- Throws:
DatabaseException
addToLsnINMap
protected void addToLsnINMap(Long lsn,
IN in,
int index)
fetchLSN
protected Node fetchLSN(long lsn)
throws DatabaseException
- Throws:
DatabaseException
getSavedExceptions
public List getSavedExceptions()
Copyright 2004-2006 Sleepycat, Inc. All Rights Reserved.