Search in sources :

Example 21 with MemoryBlobStore

use of org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore in project jackrabbit-oak by apache.

the class AsyncIndexUpdateClusterTestIT method create.

private DocumentNodeStore create(int clusterId) {
    DocumentMK.Builder builder = new DocumentMK.Builder();
    if (ds == null) {
        ds = new MemoryDocumentStore();
    }
    if (bs == null) {
        bs = new MemoryBlobStore();
    }
    builder.setDocumentStore(ds).setBlobStore(bs);
    DocumentNodeStore store = builder.setClusterId(++clusterId).setLeaseCheck(false).open().getNodeStore();
    return store;
}
Also used : MemoryDocumentStore(org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore) DocumentMK(org.apache.jackrabbit.oak.plugins.document.DocumentMK) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) DocumentNodeStore(org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore) MemoryBlobStore(org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore)

Example 22 with MemoryBlobStore

use of org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore in project jackrabbit-oak by apache.

the class ActiveDeletedBlobCollectorMBeanImplTest method orderOfFlaggingWaitForIndexersAndUpdateIndexFiles.

@Test
public void orderOfFlaggingWaitForIndexersAndUpdateIndexFiles() {
    final AtomicBoolean isPaused = new AtomicBoolean();
    final AtomicBoolean hadWaitedForIndex = new AtomicBoolean();
    IndexPathService indexPathService = mock(IndexPathService.class);
    when(indexPathService.getIndexPaths()).then(mockObj -> {
        assertTrue("Must wait for indexers before going to update index files", hadWaitedForIndex.get());
        return indexPaths;
    });
    AsyncIndexInfoService asyncIndexInfoService = MockRegistrar.getAsyncIndexInfoService(newArrayList(new IndexMBeanInfoSupplier("foo-async", () -> {
        assertTrue("Must pause before waiting for indexers", isPaused.get());
        hadWaitedForIndex.set(true);
        return STATUS_DONE;
    }, () -> 2L)));
    ActiveDeletedBlobCollectorMBeanImpl bean = new ActiveDeletedBlobCollectorMBeanImpl(new PauseNotifyingActiveDeletedBlobCollector(() -> {
        isPaused.set(true);
        return null;
    }), wb, nodeStore, indexPathService, asyncIndexInfoService, new MemoryBlobStore(), sameThreadExecutor());
    bean.clock = clock;
    bean.flagActiveDeletionUnsafeForCurrentState();
}
Also used : IndexPathService(org.apache.jackrabbit.oak.plugins.index.IndexPathService) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AsyncIndexInfoService(org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfoService) MemoryBlobStore(org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore) Test(org.junit.Test)

Example 23 with MemoryBlobStore

use of org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore in project jackrabbit-oak by apache.

the class ActiveDeletedBlobCollectorMBeanImplTest method getTestBean.

private ActiveDeletedBlobCollectorMBean getTestBean(IndexPathService indexPathService, AsyncIndexInfoService asyncIndexInfoService) {
    ActiveDeletedBlobCollectorMBeanImpl bean = new ActiveDeletedBlobCollectorMBeanImpl(ActiveDeletedBlobCollectorFactory.NOOP, wb, nodeStore, indexPathService, asyncIndexInfoService, new MemoryBlobStore(), sameThreadExecutor());
    bean.clock = clock;
    return bean;
}
Also used : MemoryBlobStore(org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore)

Aggregations

MemoryBlobStore (org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore)23 Test (org.junit.Test)16 MemoryDocumentStore (org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore)12 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)8 File (java.io.File)5 DocumentNodeStore (org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore)4 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)4 NodeStore (org.apache.jackrabbit.oak.spi.state.NodeStore)4 Random (java.util.Random)3 DocumentMK (org.apache.jackrabbit.oak.plugins.document.DocumentMK)3 AsyncIndexInfoService (org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfoService)3 IndexPathService (org.apache.jackrabbit.oak.plugins.index.IndexPathService)3 BlobStore (org.apache.jackrabbit.oak.spi.blob.BlobStore)3 ArrayList (java.util.ArrayList)2 Set (java.util.Set)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 InitialContent (org.apache.jackrabbit.oak.InitialContent)2 Oak (org.apache.jackrabbit.oak.Oak)2 PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)2 Before (org.junit.Before)2