Ver Fonte

控制输出节点

xufei há 3 meses atrás
pai
commit
b072e5c902

+ 6 - 0
src/main/java/com/winhc/max/compute/graph/job/holder/HolderRelationGroupVertex.java

@@ -28,11 +28,13 @@ public class HolderRelationGroupVertex extends
         Vertex<Text, HolderRelationGroupVertexValue, HolderRelationGroupEdge, HolderRelationGroupMsg> {
 
     private static Integer node_limit;
+    private static Integer run_step;
 
 
     @Override
     public void setup(WorkerContext<Text, HolderRelationGroupVertexValue, HolderRelationGroupEdge, HolderRelationGroupMsg> context) throws IOException {
         node_limit = context.getConfiguration().getInt("node_limit", 100);
+        run_step = context.getConfiguration().getInt("run_step", 1);
     }
 
     @Override
@@ -151,6 +153,10 @@ public class HolderRelationGroupVertex extends
 
                 if (collect.size() > 0) {
 
+                    //控制累加层数
+                    if(size >= run_step){
+                        continue;
+                    }
                     if (size - 1 > i) {
                         currentExtendChains.get(i + 1).addAll(collect);
                     } else {