Index: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentIdTableTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentIdTableTest.java (date 1462977427000) +++ oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentIdTableTest.java (revision ) @@ -25,8 +25,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.concurrent.Callable; @@ -34,7 +32,6 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import com.google.common.base.Predicate; import org.apache.jackrabbit.oak.segment.memory.MemoryStore; import org.junit.Test; @@ -93,46 +90,9 @@ assertEquals(16 * 1024, tbl.getEntryCount()); assertEquals(16 * 2048, tbl.getMapSize()); assertEquals(5, tbl.getMapRebuildCount()); - } - } - - @Test - public void clearTable() throws IOException { - SegmentTracker tracker = new MemoryStore().getTracker(); - final SegmentIdTable tbl = new SegmentIdTable(tracker); - - List refs = new ArrayList(); - int originalCount = 8; - for (int i = 0; i < originalCount; i++) { - refs.add(tbl.getSegmentId(i, i % 2)); - } - assertEquals(originalCount, tbl.getEntryCount()); - assertEquals(0, tbl.getMapRebuildCount()); - - tbl.clearSegmentIdTables(new Predicate() { - @Override - public boolean apply(SegmentId id) { - return id.getMostSignificantBits() < 4; - } - }); - - assertEquals(4, tbl.getEntryCount()); - - for (SegmentId id : refs) { - if (id.getMostSignificantBits() >= 4) { - SegmentId id2 = tbl.getSegmentId( - id.getMostSignificantBits(), - id.getLeastSignificantBits()); - List list = tbl.getRawSegmentIdList(); - if (list.size() != new HashSet(list).size()) { - Collections.sort(list); - fail("duplicate entry " + list.toString()); - } - assertTrue(id == id2); - } } } - + @Test public void justHashCollisions() throws IOException { SegmentTracker tracker = new MemoryStore().getTracker(); \ No newline at end of file Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (date 1462977427000) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (revision ) @@ -63,7 +63,6 @@ import javax.annotation.Nonnull; import com.google.common.base.Predicate; -import com.google.common.base.Predicates; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import org.apache.jackrabbit.oak.api.Blob; @@ -1119,10 +1118,6 @@ } if (success) { tracker.getWriter().addCachedNodes(gcGeneration, nodeCache); - // FIXME OAK-4285: Align cleanup of segment id tables with the new cleanup strategy - // ith clean brutal we need to remove those ids that have been cleaned - // i.e. those whose segment was from an old generation - tracker.clearSegmentIdTables(Predicates.alwaysFalse()); // FIXME OAK-4283: Align GCMonitor API with implementation // Refactor GCMonitor: there is no more compaction map stats gcMonitor.compacted(new long[]{}, new long[]{}, new long[]{}); Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentIdTable.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentIdTable.java (date 1462977427000) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentIdTable.java (revision ) @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; -import com.google.common.base.Predicate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -192,31 +191,8 @@ private int getIndex(long lsb) { return ((int) lsb) & (references.size() - 1); - } - - synchronized void clearSegmentIdTables(Predicate canRemove) { - int size = references.size(); - boolean dirty = false; - for (WeakReference reference : references) { - if (reference != null) { - SegmentId id = reference.get(); - if (id != null) { - if (canRemove.apply(id)) { - // we clear the reference here, but we must not - // remove the reference from the list, because - // that could cause duplicate references - // (there is a unit test for this case) - reference.clear(); - dirty = true; - } - } - } - } - if (dirty) { - refresh(); - } } - + /** * Get the number of map rebuild operations (used for testing and diagnostics). * Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java (date 1462977427000) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java (revision ) @@ -30,7 +30,6 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import com.google.common.base.Predicate; import com.google.common.cache.RemovalCause; import org.apache.jackrabbit.oak.cache.CacheLIRS; import org.apache.jackrabbit.oak.cache.CacheLIRS.EvictionCallback; @@ -292,15 +291,6 @@ long msb = (random.nextLong() & MSB_MASK) | VERSION; long lsb = (random.nextLong() & LSB_MASK) | type; return getSegmentId(msb, lsb); - } - - // FIXME OAK-4285: Align cleanup of segment id tables with the new cleanup strategy - // ith clean brutal we need to remove those ids that have been cleaned - // i.e. those whose segment was from an old generation - public synchronized void clearSegmentIdTables(Predicate canRemove) { - for (SegmentIdTable table : tables) { - table.clearSegmentIdTables(canRemove); - } } }