瀏覽代碼

加入参数

xufei 2 年之前
父節點
當前提交
127d2c8ec5
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/main/java/com/winhc/max/compute/graph/job/CompanyConnectedComponents.java

+ 8 - 2
src/main/java/com/winhc/max/compute/graph/job/CompanyConnectedComponents.java

@@ -112,11 +112,17 @@ public class CompanyConnectedComponents {
 
 
     public static void main(String[] args) throws IOException {
-        if (args.length < 2) {
-            System.out.println("Usage: <input> <output>");
+        if (args.length < 4) {
+            System.out.println("Usage: <input> <output> <worker> <cu>");
             System.exit(-1);
         }
+        Integer worker = Integer.parseInt(args[2]);
+        Integer cu = Integer.parseInt(args[3]);
         GraphJob job = new GraphJob();
+//        job.setNumWorkers(50);
+//        job.setWorkerCPU(100);
+        job.setNumWorkers(worker);
+        job.setWorkerCPU(cu);
         job.setGraphLoaderClass(CCVertexReader.class);
         job.setVertexClass(CCVertex.class);
         job.setCombinerClass(MinLongCombiner.class);