use of org.apache.jackrabbit.oak.spi.blob.split.DefaultSplitBlobStore 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);
}
use of org.apache.jackrabbit.oak.spi.blob.split.DefaultSplitBlobStore in project jackrabbit-oak by apache.
the class AbstractMigratorTest method setup.
@Before
public void setup() throws CommitFailedException, IllegalArgumentException, IOException {
Path target = FileSystems.getDefault().getPath("target");
repository = java.nio.file.Files.createTempDirectory(target, "migrate-").toFile();
BlobStore oldBlobStore = createOldBlobStore(repository);
NodeStore originalNodeStore = createNodeStore(oldBlobStore, repository);
createContent(originalNodeStore);
closeNodeStore();
newBlobStore = createNewBlobStore(repository);
DefaultSplitBlobStore splitBlobStore = new DefaultSplitBlobStore(repository.getPath(), oldBlobStore, newBlobStore);
nodeStore = createNodeStore(splitBlobStore, repository);
migrator = new BlobMigrator(splitBlobStore, nodeStore);
}
use of org.apache.jackrabbit.oak.spi.blob.split.DefaultSplitBlobStore in project jackrabbit-oak by apache.
the class SplitBlobStoreTest method setup.
@Before
public void setup() throws IOException {
repository = Files.createTempDir();
oldBlobStore = new FileBlobStore(repository.getPath() + "/old");
newBlobStore = new FileBlobStore(repository.getPath() + "/new");
splitBlobStore = new DefaultSplitBlobStore(repository.getPath(), oldBlobStore, newBlobStore);
oldBlobIds = addBlobs(oldBlobStore);
newBlobIds = addBlobs(splitBlobStore);
}
Aggregations