use of org.apache.jackrabbit.oak.plugins.index.lucene.directory.ActiveDeletedBlobCollectorFactory.BlobDeletionCallback in project jackrabbit-oak by apache.
the class ActiveDeletedBlobCollectorTest method deleteBlobsDespiteFileExplicitlyPurgedBeforeRestart.
@Test
public void deleteBlobsDespiteFileExplicitlyPurgedBeforeRestart() throws Exception {
BlobDeletionCallback bdc = adbc.getBlobDeletionCallback();
bdc.deleted("blobId1", Collections.singleton("/a"));
bdc.commitProgress(COMMIT_SUCCEDED);
clock.waitUntil(clock.getTime() + TimeUnit.MINUTES.toMillis(1));
createBlobCollector();
bdc = adbc.getBlobDeletionCallback();
bdc.deleted("blobId2", Collections.singleton("/b"));
bdc.commitProgress(COMMIT_SUCCEDED);
clock.waitUntil(clock.getTime() + TimeUnit.MINUTES.toMillis(1));
createBlobCollector();
bdc = adbc.getBlobDeletionCallback();
bdc.deleted("blobId3", Collections.singleton("/c"));
bdc.commitProgress(COMMIT_SUCCEDED);
adbc.purgeBlobsDeleted(clock.getTimeIncreasing(), blobStore);
verifyBlobsDeleted("blobId1", "blobId2", "blobId3");
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.directory.ActiveDeletedBlobCollectorFactory.BlobDeletionCallback in project jackrabbit-oak by apache.
the class ActiveDeletedBlobCollectorTest method uncommittedDeletionsMustNotBePurged.
@Test
public void uncommittedDeletionsMustNotBePurged() throws Exception {
BlobDeletionCallback bdc1 = adbc.getBlobDeletionCallback();
bdc1.deleted("blobId1", Collections.singleton("/a"));
bdc1.commitProgress(COMMIT_FAILED);
BlobDeletionCallback bdc2 = adbc.getBlobDeletionCallback();
bdc2.deleted("blobId2", Collections.singleton("/b"));
bdc2.commitProgress(COMMIT_SUCCEDED);
adbc.purgeBlobsDeleted(clock.getTimeIncreasing(), blobStore);
//blobId2 is committed later
verifyBlobsDeleted("blobId2");
}
Aggregations