Browse Source

feat: 限制company_rank资源上限

许家凯 2 years ago
parent
commit
bdc8fbf0a9

+ 2 - 0
src/main/java/com/winhc/max/compute/graph/job/CompanyRankGraphJob.java

@@ -26,6 +26,7 @@ public class CompanyRankGraphJob {
         String maxIter = parameterTool.getOrDefault("maxIter", "30");
         String variance = parameterTool.getOrDefault("variance", "0.00000001");
         String numWorkers = parameterTool.getOrDefault("numWorkers", "70");
+        String workerCPU = parameterTool.getOrDefault("workerCPU", "2");
 
         System.out.println("input args: " + String.join(" ", args));
 
@@ -34,6 +35,7 @@ public class CompanyRankGraphJob {
         job.set("company.rank.variance", variance);
         job.setMaxIteration(-1);
         job.setNumWorkers(Integer.parseInt(numWorkers));
+        job.setWorkerCPU(Integer.parseInt(workerCPU) * 100);
 
 
         job.setGraphLoaderClass(CompanyRankVertexReader.class);