Author: amitj
Date: Thu Aug 10 04:00:25 2017
New Revision: 1804628

URL: http://svn.apache.org/viewvc?rev=1804628&view=rev
Log:
OAK-6504: Active deletion of blobs needs to indicate information about purged 
blobs to mark-sweep collector

- Slightly modified test to remove a redundant check

Modified:
    
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ActiveDeletedBlobSyncTrackerTest.java

Modified: 
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ActiveDeletedBlobSyncTrackerTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ActiveDeletedBlobSyncTrackerTest.java?rev=1804628&r1=1804627&r2=1804628&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ActiveDeletedBlobSyncTrackerTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ActiveDeletedBlobSyncTrackerTest.java
 Thu Aug 10 04:00:25 2017
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.plugin
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
@@ -128,8 +129,6 @@ public class ActiveDeletedBlobSyncTracke
         assertEquals("Hack purge must not purge any blob (second commit)",
             secondCommitNumChunks, hackPurgeNumChunks);
 
-        List<String> beforeDeletionIds = 
newArrayList(blobStore.getAllChunkIds(-1));
-
         adbc.purgeBlobsDeleted(time, blobStore);
         adbc.getBlobDeletionCallback();
         long firstGCNumChunks = blobStore.numChunks;
@@ -138,24 +137,18 @@ public class ActiveDeletedBlobSyncTracke
         assertTrue("First commit must create some chunks", 
secondCommitNumChunks > firstCommitNumChunks);
         assertTrue("First GC should delete some chunks", firstGCNumChunks < 
secondCommitNumChunks);
 
-        List<String> afterDeletionIds = 
newArrayList(blobStore.getAllChunkIds(-1));
-
-        assertTrackedDeleted(beforeDeletionIds, afterDeletionIds, blobStore);
+        assertTrackedDeleted(blobStore.getAllChunkIds(-1), blobStore);
     }
 
-    private static void assertTrackedDeleted(List<String> beforeDeletionIds,
-        List<String> afterDeletionIds,
+    private static void assertTrackedDeleted(Iterator<String> afterDeletions,
         GarbageCollectableBlobStore blobStore) throws IOException {
 
+        List<String> afterDeletionIds = newArrayList(afterDeletions);
         // get the currently tracked ones
         ArrayList<String> trackedIds = newArrayList(((BlobTrackingStore) 
blobStore).getTracker().get());
+        assertEquals("Tracked ids length different from current blob list",
+            trackedIds.size(), afterDeletionIds.size());
         assertTrue("Tracked ids different from current blob list",
             newHashSet(trackedIds).equals(newHashSet(afterDeletionIds)));
-
-        // get the deleted ones
-        beforeDeletionIds.removeAll(afterDeletionIds);
-        // tracked should not contain the deleted
-        assertTrue("Blob tracker not synced",
-            intersection(newHashSet(beforeDeletionIds), 
newHashSet(trackedIds)).isEmpty());
     }
 }


Reply via email to