boolean logProvisionally,
boolean allowDeltas,
long checkpointStart)
throws DatabaseException {
Tree tree = targetRef.db.getTree();
boolean targetWasRoot = false;
if (targetRef.isDbRoot) {
/* We're trying to flush the root. */
RootFlusher flusher =
new RootFlusher(targetRef.db, logManager, targetRef.nodeId);
tree.withRootLatched(flusher);
boolean flushed = flusher.getFlushed();
/*
* If this target isn't the root anymore, we'll have to handled it
* like a regular node.
*/
targetWasRoot = flusher.stillRoot();
/*
* Update the tree's owner, whether it's the env root or the
* dbmapping tree.
*/
if (flushed) {
DbTree dbTree = targetRef.db.getDbEnvironment().getDbMapTree();
dbTree.modifyDbRoot(targetRef.db);
nFullINFlushThisRun++;
nFullINFlush++;
}
}
/*
* The following attempt to flush applies to two cases:
*
* (1) the target was not ever the root
*
* (2) the target was the root, when the checkpoint dirty set was
* assembled but is not the root now.
*
*/
if (!targetWasRoot) {
/*
* The "isRoot" param is used to stop a search in
* BIN.descendOnParentSearch and is passed as false (never stop).
*/
SearchResult result =
tree.getParentINForChildIN(targetRef.nodeId,
targetRef.containsDuplicates,
false, // isRoot
targetRef.mainTreeKey,
targetRef.dupTreeKey,
false, // requireExactMatch