giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: updated refs/heads/trunk to 83d06d9
Date Mon, 02 Oct 2017 22:33:00 GMT
Repository: giraph
Updated Branches:
  refs/heads/trunk 3bbac90fc -> 83d06d95d


GIRAPH-1162

closes #51


Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/83d06d95
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/83d06d95
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/83d06d95

Branch: refs/heads/trunk
Commit: 83d06d95dd70db6e3340afead3bd32fa58d9a396
Parents: 3bbac90
Author: Yuksel Akinci <yuksela@fb.com>
Authored: Mon Oct 2 14:41:32 2017 -0700
Committer: Maja Kabiljo <majakabiljo@fb.com>
Committed: Mon Oct 2 15:30:53 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/giraph/conf/GiraphConstants.java   | 9 +++++++++
 .../main/java/org/apache/giraph/graph/ComputeCallable.java  | 8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/83d06d95/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java b/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
index 63f6aca..9340472 100644
--- a/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
+++ b/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
@@ -1181,6 +1181,15 @@ public interface GiraphConstants {
           JobProgressTrackerService.class,
           "Class to use to track job progress on client");
 
+  /**
+   * Minimum number of vertices to compute before adding to worker progress.
+   */
+  LongConfOption VERTICES_TO_UPDATE_PROGRESS =
+          new LongConfOption("giraph.VerticesToUpdateProgress", 100000,
+                  "Minimum number of vertices to compute before " +
+                          "updating worker progress");
+
+
   /** Number of retries for creating the HDFS files */
   IntConfOption HDFS_FILE_CREATION_RETRIES =
       new IntConfOption("giraph.hdfs.file.creation.retries", 10,

http://git-wip-us.apache.org/repos/asf/giraph/blob/83d06d95/giraph-core/src/main/java/org/apache/giraph/graph/ComputeCallable.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/graph/ComputeCallable.java b/giraph-core/src/main/java/org/apache/giraph/graph/ComputeCallable.java
index 91b740b..cdd9877 100644
--- a/giraph-core/src/main/java/org/apache/giraph/graph/ComputeCallable.java
+++ b/giraph-core/src/main/java/org/apache/giraph/graph/ComputeCallable.java
@@ -26,6 +26,7 @@ import org.apache.giraph.bsp.CentralizedServiceWorker;
 import org.apache.giraph.comm.WorkerClientRequestProcessor;
 import org.apache.giraph.comm.messages.MessageStore;
 import org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor;
+import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
 import org.apache.giraph.function.primitive.PrimitiveRefs.LongRef;
 import org.apache.giraph.io.SimpleVertexWriter;
@@ -78,7 +79,7 @@ public class ComputeCallable<I extends WritableComparable, V extends
Writable,
   /** Class time object */
   private static final Time TIME = SystemTime.get();
   /** How often to update WorkerProgress */
-  private static final long VERTICES_TO_UPDATE_PROGRESS = 100000;
+  private final long verticesToUpdateProgress;
   /** Context */
   private final Mapper<?, ?, ?, ?>.Context context;
   /** Graph state */
@@ -140,6 +141,8 @@ public class ComputeCallable<I extends WritableComparable, V extends
Writable,
         metrics.getUniformHistogram("wait-per-thread-ms");
     histogramProcessingTimePerThread =
         metrics.getUniformHistogram("processing-per-thread-ms");
+    verticesToUpdateProgress =
+        GiraphConstants.VERTICES_TO_UPDATE_PROGRESS.get(configuration);
   }
 
   @Override
@@ -278,11 +281,12 @@ public class ComputeCallable<I extends WritableComparable, V extends
Writable,
     PartitionStats partitionStats =
         new PartitionStats(partition.getId(), 0, 0, 0, 0, 0);
     final LongRef verticesComputedProgress = new LongRef(0);
+
     Progressable verticesProgressable = new Progressable() {
       @Override
       public void progress() {
         verticesComputedProgress.value++;
-        if (verticesComputedProgress.value == VERTICES_TO_UPDATE_PROGRESS) {
+        if (verticesComputedProgress.value == verticesToUpdateProgress) {
           WorkerProgress.get().addVerticesComputed(
               verticesComputedProgress.value);
           verticesComputedProgress.value = 0;


Mime
View raw message