A callback 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 resident INs using the roots that were specified when the SLTW was constructed. For each child of each root, if the child is resident it is 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 passed to the callback for all LSNs collected, phase 1 is complete.
In phase 2, 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. LSNs are accumlated in batches in this phase so that memory consumption is not excessive. For instance, if batches were not used then the LSNs of all of the BINs would need to be held in memory.
|
|
|
|
|
|