You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2015/12/15 10:22:34 UTC

svn commit: r1720096 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java

Author: mduerig
Date: Tue Dec 15 09:22:33 2015
New Revision: 1720096

URL: http://svn.apache.org/viewvc?rev=1720096&view=rev
Log:
OAK-3774: Tool for detecting references to pre compacted segments
Remove out degree from vertices in gc graph as those can be inferred from the edges

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java?rev=1720096&r1=1720095&r2=1720096&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentGraph.java Tue Dec 15 09:22:33 2015
@@ -174,9 +174,9 @@ public final class SegmentGraph {
         try {
             Graph<Integer> gcGraph = parseGCGraph(checkNotNull(fileStore));
 
-            writer.write("nodedef>name VARCHAR, out-degree INT\n");
+            writer.write("nodedef>name VARCHAR\n");
             for (Integer gen : gcGraph.vertices) {
-                writer.write(gen + "," + getOutDegree(gcGraph, gen) + "\n");
+                writer.write(gen + "\n");
             }
 
             writer.write("edgedef>node1 VARCHAR, node2 VARCHAR\n");
@@ -193,22 +193,6 @@ public final class SegmentGraph {
         }
     }
 
-    private static int getOutDegree(Graph<Integer> gcGraph, Integer gen) {
-        Set<Integer> tos = gcGraph.edges.get(gen);
-        if (tos == null) {
-            return 0;
-        } else {
-            int degree = tos.size();
-            if (tos.contains(-1)) {  // don't count edges to bulk segments
-                degree--;
-            }
-            if (tos.contains(gen)) { // don't call edges to self
-                degree--;
-            }
-            return degree;
-        }
-    }
-
     /**
      * Parse the gc generation graph of a file store.
      *