use of org.apache.jackrabbit.oak.spi.blob.split.WrappingSplitBlobStore in project jackrabbit-oak by apache.
the class SplitBlobStoreService method registerSplitBlobStore.
private void registerSplitBlobStore() {
if (oldBlobStore == null && oldBlobStoreType == BlobStoreType.EXTERNAL) {
log.info("No BlobStore with ({}=old)", PROP_SPLIT_BLOBSTORE);
return;
}
if (newBlobStore == null) {
log.info("No BlobStore with ({}=new)", PROP_SPLIT_BLOBSTORE);
return;
}
if (reg != null) {
log.info("SplitBlobStore already registered");
return;
}
if (ctx == null) {
log.info("Component not activated yet");
return;
}
log.info("Registering SplitBlobStore with old={} ({}) and new={}", oldBlobStore, oldBlobStoreType, newBlobStore);
BlobStore blobStore;
if (oldBlobStoreType == EXTERNAL || oldBlobStoreType == SEGMENT) {
blobStore = new DefaultSplitBlobStore(homeDir, oldBlobStore, newBlobStore);
} else if (oldBlobStoreType == DOCUMENT) {
blobStore = new WrappingSplitBlobStore(homeDir, newBlobStore);
} else {
throw new IllegalStateException("Illegal blob store type value: " + oldBlobStoreType);
}
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put("service.pid", "org.apache.jackrabbit.oak.spi.blob.split.SplitBlobStore");
reg = ctx.registerService(new String[] { BlobStore.class.getName() }, blobStore, props);
}
Aggregations