use of org.apache.jackrabbit.oak.plugins.index.IndexUpdate in project jackrabbit-oak by apache.
the class OutOfBandIndexer method preformIndexUpdate.
private void preformIndexUpdate(NodeState baseState) throws IOException, CommitFailedException {
NodeBuilder builder = copyOnWriteStore.getRoot().builder();
IndexUpdate indexUpdate = new IndexUpdate(createIndexEditorProvider(), REINDEX_LANE, copyOnWriteStore.getRoot(), builder, this, this, CommitInfo.EMPTY, CorruptIndexHandler.NOOP);
configureEstimators(indexUpdate);
//Do not use EmptyState as before otherwise the IndexUpdate would
//unnecessary traverse the whole repo post reindexing. With use of baseState
//It would only traverse the diff i.e. those index definitions paths
//whose lane has been changed
NodeState before = baseState;
NodeState after = copyOnWriteStore.getRoot();
CommitFailedException exception = EditorDiff.process(VisibleEditor.wrap(indexUpdate), before, after);
if (exception != null) {
throw exception;
}
}
Aggregations