use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class RefreshOnGCTest method setup.
@Before
public void setup() throws Exception {
File directory = createTempFile(getClass().getSimpleName(), "test", new File("target"));
directory.delete();
directory.mkdir();
Whiteboard whiteboard = new DefaultWhiteboard();
gcMonitor = new GCMonitorTracker();
gcMonitor.start(whiteboard);
Oak oak = new Oak(createSegmentTarStore(directory, gcMonitor));
oak.with(whiteboard);
repository = new Jcr(oak).createRepository();
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class AbstractBinaryAccessIT method createRepository.
/**
* Adjust JCR repository creation to register BlobAccessProvider (BlobStore) in Whiteboard
* so it can be picked up by oak-jcr.
*/
@Override
protected Repository createRepository(NodeStore nodeStore) {
Whiteboard wb = new DefaultWhiteboard();
BlobStore blobStore = getNodeStoreComponent(BlobStore.class);
if (blobStore != null && blobStore instanceof BlobAccessProvider) {
wb.register(BlobAccessProvider.class, (BlobAccessProvider) blobStore, Collections.emptyMap());
}
return initJcr(new Jcr(nodeStore).with(wb)).createRepository();
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class BinaryAccessUnsupportedIT method createRepository.
@Override
protected Repository createRepository(NodeStore nodeStore) {
Whiteboard wb = new DefaultWhiteboard();
BlobStore blobStore = getNodeStoreComponent(BlobStore.class);
if (blobStore != null && blobStore instanceof BlobAccessProvider) {
wb.register(BlobAccessProvider.class, (BlobAccessProvider) blobStore, Collections.emptyMap());
}
return initJcr(new Jcr(nodeStore).with(wb)).createRepository();
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class AbstractDelegatorTest method mockSessionDelegate.
@NotNull
static SessionDelegate mockSessionDelegate(@NotNull Root root, @NotNull PermissionProvider pp) {
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
Whiteboard wb = new DefaultWhiteboard();
StatisticManager statisticManager = new StatisticManager(wb, executorService);
return spy(new SessionDelegate(mockContentSession(root), mockSecurityProvider(root, pp), RefreshStrategy.Composite.create(), new ThreadLocal<>(), statisticManager, new Clock.Virtual()));
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class ActiveDeletedBlobDisabledTest method test.
private void test(final boolean disabled) {
String property = "oak.active.deletion.disabled";
try {
System.setProperty(property, "" + disabled);
NodeStore store = null;
IndexPathService indexPathService = null;
AsyncIndexInfoService asyncIndexInfoService = null;
Executor executor = new Executor() {
@Override
public void execute(Runnable command) {
command.run();
}
};
ActiveDeletedBlobCollectorMBeanImpl b = new ActiveDeletedBlobCollectorMBeanImpl(ActiveDeletedBlobCollectorFactory.NOOP, new DefaultWhiteboard(), store, indexPathService, asyncIndexInfoService, new MemoryBlobStore(), executor);
b.isActiveDeletionUnsafe();
b.isDisabled();
CompositeData d = b.startActiveCollection();
if (disabled) {
// none
assertEquals(1, d.get("code"));
assertEquals("Active deletion is disabled", d.get("message"));
} else {
// failed
assertEquals(5, d.get("code"));
assertEquals("Active lucene index blobs collection couldn't be run as a safe timestamp for purging lucene index blobs couldn't be evaluated", d.get("message"));
}
} finally {
System.clearProperty(property);
}
}
Aggregations