Search in sources :

Example 1 with IndexUpdate

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;
    }
}
Also used : IndexUpdate(org.apache.jackrabbit.oak.plugins.index.IndexUpdate) NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) CommitFailedException(org.apache.jackrabbit.oak.api.CommitFailedException)

Aggregations

CommitFailedException (org.apache.jackrabbit.oak.api.CommitFailedException)1 IndexUpdate (org.apache.jackrabbit.oak.plugins.index.IndexUpdate)1 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)1 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)1