use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.
the class LoopbackBlobStoreTest method writingBinariesWithBlobOptsIsNotSupported.
@Test(expected = UnsupportedOperationException.class)
public void writingBinariesWithBlobOptsIsNotSupported() throws IOException {
given: {
final BlobStore blobStore = new LoopbackBlobStore();
final BlobOptions blobOptions = new BlobOptions();
when: {
blobStore.writeBlob(adaptToUtf8InputStream("Test"), blobOptions);
}
}
}
use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.
the class AbstractBlobGCRegistrationTest method testBlobGcRegistered.
@Test
public void testBlobGcRegistered() throws Exception {
registerNodeStoreService();
assertServiceNotActivated();
registerBlobStore();
assertServiceActivated();
BlobGCMBean mbean = context.getService(BlobGCMBean.class);
assertNotNull(mbean);
// Check repository id present
BlobStore store = context.getService(BlobStore.class);
assertNotNull(((DataStoreBlobStore) store).getRepositoryId());
unregisterNodeStoreService();
unregisterBlobStore();
}
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);
// see OAK-6066
NodeBuilder builder = nodeStore.getRoot().builder();
builder.setProperty("foo", "bar");
nodeStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
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