use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.
the class OakCachingFDSTest method registerCachingFDS.
private void registerCachingFDS() {
Map<String, Object> props = newHashMap();
props.put("cachePath", path);
props.put("path", fsBackendPath);
props.put("cacheSize", "10");
props.put("repository.home", new File(fsBackendPath).getParentFile().getAbsolutePath());
context.registerInjectActivateService(new FileDataStoreService(), props);
assertNotNull(context.getService(BlobStore.class));
BlobStore blobStore = context.getService(BlobStore.class);
assert blobStore instanceof DataStoreBlobStore;
DataStore ds = ((DataStoreBlobStore) blobStore).getDataStore();
assert ds instanceof OakCachingFDS;
dataStore = (OakCachingFDS) ds;
}
use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.
the class SegmentTarFixture method setUpCluster.
@Override
public Oak[] setUpCluster(int n, StatisticsProvider statsProvider) throws Exception {
Oak[] cluster = new Oak[n];
stores = new FileStore[cluster.length];
if (useBlobStore) {
blobStoreFixtures = new BlobStoreFixture[cluster.length];
}
for (int i = 0; i < cluster.length; i++) {
BlobStore blobStore = null;
if (useBlobStore) {
blobStoreFixtures[i] = BlobStoreFixture.create(base, true, dsCacheSizeInMB, statsProvider);
blobStore = blobStoreFixtures[i].setUp();
}
FileStoreBuilder builder = fileStoreBuilder(new File(base, unique));
if (blobStore != null) {
builder.withBlobStore(blobStore);
}
stores[i] = builder.withMaxFileSize(maxFileSizeMB).withStatisticsProvider(statsProvider).withSegmentCacheSize(cacheSizeMB).withMemoryMapping(memoryMapping).build();
cluster[i] = newOak(SegmentNodeStoreBuilders.builder(stores[i]).build());
}
return cluster;
}
use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.
the class AbstractBlobTrackerRegistrationTest method registerBlobTrackingStore.
@Test
public void registerBlobTrackingStore() throws Exception {
registerNodeStoreService();
assertServiceNotActivated();
registerTrackingBlobStore();
assertServiceActivated();
BlobStore blobStore = context.getService(BlobStore.class);
assertTrue(blobStore instanceof BlobTrackingStore);
BlobTrackingStore trackingStore = (BlobTrackingStore) blobStore;
assertNotNull(trackingStore.getTracker());
}
use of org.apache.jackrabbit.oak.spi.blob.BlobStore 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.BlobStore in project jackrabbit-oak by apache.
the class FileBlobStoreService method activate.
@Activate
protected void activate(ComponentContext context, Map<String, Object> config) {
String homeDir = lookup(context, PROP_HOME);
if (homeDir != null) {
log.info("Initializing the FileBlobStore with homeDir [{}]", homeDir);
}
BlobStore blobStore = new FileBlobStore(FilenameUtils.concat(homeDir, "datastore"));
PropertiesUtil.populate(blobStore, config, false);
Dictionary<String, Object> props = new Hashtable<String, Object>();
if (context.getProperties().get(PROP_SPLIT_BLOBSTORE) != null) {
props.put(PROP_SPLIT_BLOBSTORE, context.getProperties().get(PROP_SPLIT_BLOBSTORE));
}
reg = context.getBundleContext().registerService(new String[] { BlobStore.class.getName(), GarbageCollectableBlobStore.class.getName() }, blobStore, props);
}
Aggregations