Search in sources :

Example 6 with ChangeSet

use of org.apache.jackrabbit.oak.plugins.observation.ChangeSet in project jackrabbit-oak by apache.

the class ChangeSetFilterImplTest method manyIncludePaths.

@Test
public void manyIncludePaths() throws Exception {
    int numPaths = 50;
    ChangeSetBuilder builder = newBuilder(50, 9);
    for (int i = 0; i < numPaths; i++) {
        builder.addParentPath("/a/b/c/d/e/n" + i);
    }
    ChangeSet cs = builder.build();
    Set<String> includes = Sets.newHashSet();
    for (int i = 0; i < 100; i++) {
        includes.add("/foo/bar/n-" + i + "/*.jsp");
    }
    ChangeSetFilter filter = new ChangeSetFilterImpl(s(), true, includes, s(), s(), s(), s());
    // warm up
    doManyIncludePaths(filter, cs);
    // and measure
    Stopwatch sw = Stopwatch.createStarted();
    doManyIncludePaths(filter, cs);
    LOG.info("manyIncludePaths() took {}", sw.stop());
}
Also used : ChangeSetBuilder(org.apache.jackrabbit.oak.plugins.observation.ChangeSetBuilder) Stopwatch(com.google.common.base.Stopwatch) ChangeSet(org.apache.jackrabbit.oak.plugins.observation.ChangeSet) Test(org.junit.Test)

Aggregations

ChangeSet (org.apache.jackrabbit.oak.plugins.observation.ChangeSet)6 Test (org.junit.Test)5 CommitContext (org.apache.jackrabbit.oak.spi.commit.CommitContext)4 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)4 SimpleCommitContext (org.apache.jackrabbit.oak.core.SimpleCommitContext)3 CommitInfo (org.apache.jackrabbit.oak.spi.commit.CommitInfo)3 Stopwatch (com.google.common.base.Stopwatch)1 CommitInfoCollector (org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdateTest.CommitInfoCollector)1 PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)1 ChangeSetBuilder (org.apache.jackrabbit.oak.plugins.observation.ChangeSetBuilder)1