Search in sources :

Example 1 with OakFixture

use of org.apache.jackrabbit.oak.fixture.OakFixture in project jackrabbit-oak by apache.

the class PersistentCacheTest method createRepository.

@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
    System.setProperty("PersistentCacheStats.rejectedPut", "true");
    if (fixture instanceof OakRepositoryFixture) {
        OakFixture oakFixture = ((OakRepositoryFixture) fixture).getOakFixture();
        if (oakFixture instanceof OakFixture.MongoFixture) {
            OakFixture.MongoFixture mongoFixture = (OakFixture.MongoFixture) oakFixture;
            DocumentMK.Builder builder = mongoFixture.getBuilder(1);
            builder.setStatisticsProvider(statsProvider);
            builder.setPersistentCache("target/persistentCache,time," + CACHE_OPTIONS);
            dns = builder.getNodeStore();
            nodesCache = DocumentNodeStoreHelper.getNodesCache(dns);
            Oak[] cluster = mongoFixture.setUpCluster(new DocumentMK.Builder[] { builder }, statsProvider);
            return new Repository[] { new Jcr(cluster[0]).createRepository() };
        }
    }
    throw new IllegalArgumentException("Fixture " + fixture + " not supported for this benchmark.");
}
Also used : OakRepositoryFixture(org.apache.jackrabbit.oak.fixture.OakRepositoryFixture) Repository(javax.jcr.Repository) DocumentMK(org.apache.jackrabbit.oak.plugins.document.DocumentMK) OakFixture(org.apache.jackrabbit.oak.fixture.OakFixture) Oak(org.apache.jackrabbit.oak.Oak) Jcr(org.apache.jackrabbit.oak.jcr.Jcr)

Aggregations

Repository (javax.jcr.Repository)1 Oak (org.apache.jackrabbit.oak.Oak)1 OakFixture (org.apache.jackrabbit.oak.fixture.OakFixture)1 OakRepositoryFixture (org.apache.jackrabbit.oak.fixture.OakRepositoryFixture)1 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)1 DocumentMK (org.apache.jackrabbit.oak.plugins.document.DocumentMK)1