use of org.apache.jackrabbit.oak.spi.blob.FileBlobStore in project jackrabbit-oak by apache.
the class BlobStoreFixture method getFileBlobStore.
public static BlobStoreFixture getFileBlobStore(final File basedir) {
return new BlobStoreFixture("FBS") {
private File storeDir;
private FileBlobStore fbs;
@Override
public BlobStore setUp() {
storeDir = new File(basedir, unique);
fbs = new FileBlobStore(storeDir.getAbsolutePath());
configure(fbs);
return fbs;
}
@Override
public void tearDown() {
FileUtils.deleteQuietly(storeDir);
}
@Override
public long size() {
return FileUtils.sizeOfDirectory(storeDir);
}
};
}
use of org.apache.jackrabbit.oak.spi.blob.FileBlobStore in project jackrabbit-oak by apache.
the class ReferenceBinaryIT method fixtures.
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> fixtures() throws Exception {
File file = getTestDir("tar");
FileStore fileStore = FileStoreBuilder.fileStoreBuilder(file).withBlobStore(createBlobStore()).withMaxFileSize(256).withMemoryMapping(true).build();
SegmentNodeStore sns = SegmentNodeStoreBuilders.builder(fileStore).build();
List<Object[]> fixtures = Lists.newArrayList();
SegmentTarFixture segmentTarFixture = new SegmentTarFixture(sns);
if (segmentTarFixture.isAvailable()) {
fixtures.add(new Object[] { segmentTarFixture });
}
FileBlobStore fbs = new FileBlobStore(getTestDir("fbs1").getAbsolutePath());
fbs.setReferenceKeyPlainText("foobar");
FileStore fileStoreWithFBS = FileStoreBuilder.fileStoreBuilder(getTestDir("tar2")).withBlobStore(fbs).withMaxFileSize(256).withMemoryMapping(true).build();
SegmentNodeStore snsWithFBS = SegmentNodeStoreBuilders.builder(fileStoreWithFBS).build();
SegmentTarFixture segmentTarFixtureFBS = new SegmentTarFixture(snsWithFBS);
if (segmentTarFixtureFBS.isAvailable()) {
fixtures.add(new Object[] { segmentTarFixtureFBS });
}
DocumentMongoFixture documentFixture = new DocumentMongoFixture(MongoUtils.URL, createBlobStore());
if (documentFixture.isAvailable()) {
fixtures.add(new Object[] { documentFixture });
}
return fixtures;
}
use of org.apache.jackrabbit.oak.spi.blob.FileBlobStore 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);
}
use of org.apache.jackrabbit.oak.spi.blob.FileBlobStore 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