You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by ma...@apache.org on 2017/09/15 18:11:07 UTC

[1/5] git commit: updated refs/heads/trunk to 5ccd00f

Repository: giraph
Updated Branches:
  refs/heads/trunk 448ae1c06 -> 5ccd00f0b


JIRA-1158
Giraph changes to support time estimation


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

Branch: refs/heads/trunk
Commit: e3e288b5cebf3f0c2c78569eb22a9d7577d5aa66
Parents: 448ae1c
Author: Yuksel Akinci <yu...@fb.com>
Authored: Wed Sep 13 15:40:22 2017 -0700
Committer: Yuksel Akinci <yu...@fb.com>
Committed: Wed Sep 13 16:11:39 2017 -0700

----------------------------------------------------------------------
 .../giraph/job/CombinedWorkerProgress.java      | 17 +++-
 .../job/DefaultJobProgressTrackerService.java   | 36 ++++++++
 .../apache/giraph/job/SuperstepProgress.java    | 92 ++++++++++++++++++++
 3 files changed, 144 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/e3e288b5/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
index 60951f0..567156e 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
@@ -45,7 +45,6 @@ public class CombinedWorkerProgress extends WorkerProgressStats {
       new FloatConfOption("giraph.normalFreeMemoryFraction", 0.1f,
           "If free memory fraction on some worker goes below this value, " +
               "warning will be printed");
-
   /**
    * If free memory fraction on some worker goes below this value,
    * warning will be printed
@@ -155,6 +154,22 @@ public class CombinedWorkerProgress extends WorkerProgressStats {
   }
 
   /**
+   * Get the current superstep progress.
+   * @param workerCount total worker count.
+   * @return current superstep progress
+   */
+  public SuperstepProgress getCurrentComputeSuperstepProgress(int workerCount) {
+    if (workersInSuperstep != workerCount) {
+      return null;
+    }
+    if (isComputeSuperstep()) {
+      return new SuperstepProgress(currentSuperstep, verticesComputed,
+          verticesToCompute);
+    }
+    return null;
+  }
+
+  /**
    * Get string describing total job progress
    *
    * @return String describing total job progress

http://git-wip-us.apache.org/repos/asf/giraph/blob/e3e288b5/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
index bef25df..9920750 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
@@ -107,6 +107,12 @@ public class DefaultJobProgressTrackerService
               break;
             }
 
+            if (!canFinishInTime(conf, job,
+                combinedWorkerProgress.getCurrentComputeSuperstepProgress(
+                    mappersStarted - 1))) {
+              killSlowJob();
+            }
+
             if (lastProgress == null ||
                 combinedWorkerProgress.madeProgressFrom(lastProgress)) {
               lastProgress = combinedWorkerProgress;
@@ -129,6 +135,36 @@ public class DefaultJobProgressTrackerService
   }
 
   /**
+   * Determine if the job will finish in allotted time.
+   * @param conf Giraph configuration
+   * @param job Job
+   * @param progress Current superstep progress.
+   * @return true it the job can finish in allotted time, false otherwise.
+   */
+  protected boolean canFinishInTime(GiraphConfiguration conf, Job job,
+      SuperstepProgress progress) {
+    // No defaut implementation.
+    return true;
+  }
+
+  /**
+   * Kill the job which wont be able to complete in allotted time due to slow
+   * progress.
+   */
+  protected void killSlowJob() {
+    try {
+      LOG.error("Killing the job because it won't complete in max " +
+              "allotted time: " +
+              GiraphConstants.MAX_ALLOWED_JOB_TIME_MS.get(conf) / 1000 + "s");
+      job.killJob();
+    } catch (IOException e) {
+      LOG.error(
+        "Failed to kill the job which won't complete in max allotted time: ",
+        e);
+    }
+  }
+
+  /**
    * Kill job with message describing why it's being killed
    *
    * @param message Message describing why job is being killed

http://git-wip-us.apache.org/repos/asf/giraph/blob/e3e288b5/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java b/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
new file mode 100644
index 0000000..05e9077
--- /dev/null
+++ b/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.giraph.job;
+
+/**
+ * Class which contains worker progress for a given superstep
+ *
+ */
+public class SuperstepProgress {
+  /**
+  * Current superstep
+  */
+  private long currentSuperstep;
+
+  /**
+  * Total computed vertex count
+  */
+  private long computedVertexCount;
+
+  /**
+  * Total vertex count
+  */
+  private long totalVertexCount;
+
+  /**
+  * Timestamp when this progress was created
+  */
+  private long timestamp;
+
+  /**
+   * Constructor
+   * @param currentSuperstep Current superstep
+   * @param computedVertexCount Computed vertex count
+   * @param totalVertexCount Total vertex count
+   */
+  public SuperstepProgress(long currentSuperstep, long computedVertexCount,
+      long totalVertexCount) {
+    this.currentSuperstep = currentSuperstep;
+    this.computedVertexCount = computedVertexCount;
+    this.totalVertexCount = totalVertexCount;
+    this.timestamp = System.currentTimeMillis();
+  }
+
+  /**
+   * Get current superstep
+   * @return current superstep
+   */
+  public long getCurrentSuperstep() {
+    return currentSuperstep;
+  }
+
+  /**
+   * Get computed vertex count
+   * @return Computed vertex count
+   */
+  public long getComputedVertexCount() {
+    return computedVertexCount;
+  }
+
+  /**
+   * Get total vertex count.
+   * @return total vertex count
+   */
+  public long getTotalVertexCount() {
+    return totalVertexCount;
+  }
+
+  /**
+   * Get timestamp
+   * @return timestamp of this progress
+   */
+  public long getTimestamp() {
+    return timestamp;
+  }
+}
+


[3/5] git commit: updated refs/heads/trunk to 5ccd00f

Posted by ma...@apache.org.
Adding code review feedback


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

Branch: refs/heads/trunk
Commit: 52f8caa4ffa1f746aebea8677474d7d4cb7a20d3
Parents: 93634ea
Author: Yuksel Akinci <yu...@fb.com>
Authored: Thu Sep 14 11:57:07 2017 -0700
Committer: Yuksel Akinci <yu...@fb.com>
Committed: Thu Sep 14 12:08:38 2017 -0700

----------------------------------------------------------------------
 .../job/DefaultJobProgressTrackerService.java      | 17 -----------------
 1 file changed, 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/52f8caa4/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
index a824107..5845783 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
@@ -151,23 +151,6 @@ public class DefaultJobProgressTrackerService
   }
 
   /**
-   * Kill the job which wont be able to complete in allotted time due to slow
-   * progress.
-   */
-  protected void killSlowJob() {
-    try {
-      LOG.error("Killing the job because it won't complete in max " +
-              "allotted time: " +
-              GiraphConstants.MAX_ALLOWED_JOB_TIME_MS.get(conf) / 1000 + "s");
-      job.killJob();
-    } catch (IOException e) {
-      LOG.error(
-        "Failed to kill the job which won't complete in max allotted time: ",
-        e);
-    }
-  }
-
-  /**
    * Kill job with message describing why it's being killed
    *
    * @param message Message describing why job is being killed


[4/5] git commit: updated refs/heads/trunk to 5ccd00f

Posted by ma...@apache.org.
Fixing a type


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

Branch: refs/heads/trunk
Commit: dbf5237fd9700ec4f235bff3989614600ce89703
Parents: 52f8caa
Author: Yuksel Akinci <yu...@fb.com>
Authored: Fri Sep 15 09:44:16 2017 -0700
Committer: Yuksel Akinci <yu...@fb.com>
Committed: Fri Sep 15 09:44:16 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/giraph/job/CombinedWorkerProgress.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/dbf5237f/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
index 2921d60..670a1f9 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
@@ -154,7 +154,7 @@ public class CombinedWorkerProgress extends WorkerProgressStats {
    * Get workers in superstep
    * @return Workers in superstep.
    */
-  public long getWorkerseInSuperstep() {
+  public long getWorkersInSuperstep() {
     return workersInSuperstep;
   }
 


[5/5] git commit: updated refs/heads/trunk to 5ccd00f

Posted by ma...@apache.org.
JIRA-1158

closes #47


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

Branch: refs/heads/trunk
Commit: 5ccd00f0bebe382507c995944fc5a8cfadd1bc95
Parents: dbf5237
Author: Yuksel Akinci <yu...@fb.com>
Authored: Fri Sep 15 11:03:52 2017 -0700
Committer: Maja Kabiljo <ma...@fb.com>
Committed: Fri Sep 15 11:10:20 2017 -0700

----------------------------------------------------------------------
 .../apache/giraph/job/DefaultJobProgressTrackerService.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/5ccd00f0/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
index 5845783..61228ce 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
@@ -107,8 +107,7 @@ public class DefaultJobProgressTrackerService
               break;
             }
 
-            if (!canFinishInTime(conf, job, mappersStarted - 1,
-                combinedWorkerProgress)) {
+            if (!canFinishInTime(conf, job, combinedWorkerProgress)) {
               killJobWithMessage("Killing the job because it won't " +
                 "complete in max allotted time: " +
                 GiraphConstants.MAX_ALLOWED_JOB_TIME_MS.get(conf) / 1000 +
@@ -140,12 +139,11 @@ public class DefaultJobProgressTrackerService
    * Determine if the job will finish in allotted time
    * @param conf Giraph configuration
    * @param job Job
-   * @param workerCount Worker count
    * @param progress Combined worker progress
    * @return true it the job can finish in allotted time, false otherwise
    */
   protected boolean canFinishInTime(GiraphConfiguration conf, Job job,
-      int workerCount, CombinedWorkerProgress progress) {
+      CombinedWorkerProgress progress) {
     // No defaut implementation.
     return true;
   }


[2/5] git commit: updated refs/heads/trunk to 5ccd00f

Posted by ma...@apache.org.
Adding code review feedback


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

Branch: refs/heads/trunk
Commit: 93634eafabfe609d1dd1085fab00de90520d93f4
Parents: e3e288b
Author: Yuksel Akinci <yu...@fb.com>
Authored: Thu Sep 14 11:57:07 2017 -0700
Committer: Yuksel Akinci <yu...@fb.com>
Committed: Thu Sep 14 11:57:07 2017 -0700

----------------------------------------------------------------------
 .../giraph/job/CombinedWorkerProgress.java      | 48 ++++++----
 .../job/DefaultJobProgressTrackerService.java   | 19 ++--
 .../apache/giraph/job/SuperstepProgress.java    | 92 --------------------
 3 files changed, 43 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/93634eaf/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
index 567156e..2921d60 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/CombinedWorkerProgress.java
@@ -143,6 +143,38 @@ public class CombinedWorkerProgress extends WorkerProgressStats {
   }
 
   /**
+   * Get Current superstep
+   * @return Current superstep
+   */
+  public long getCurrentSuperstep() {
+    return currentSuperstep;
+  }
+
+  /**
+   * Get workers in superstep
+   * @return Workers in superstep.
+   */
+  public long getWorkerseInSuperstep() {
+    return workersInSuperstep;
+  }
+
+  /**
+   * Get vertices computed
+   * @return Vertices computed
+   */
+  public long getVerticesComputed() {
+    return verticesComputed;
+  }
+
+  /**
+   * Get vertices to compute
+   * @return Vertices to compute
+   */
+  public long getVerticesToCompute() {
+    return verticesToCompute;
+  }
+
+  /**
    * Is the application done
    *
    * @param expectedWorkersDone Number of workers which should be done in
@@ -154,22 +186,6 @@ public class CombinedWorkerProgress extends WorkerProgressStats {
   }
 
   /**
-   * Get the current superstep progress.
-   * @param workerCount total worker count.
-   * @return current superstep progress
-   */
-  public SuperstepProgress getCurrentComputeSuperstepProgress(int workerCount) {
-    if (workersInSuperstep != workerCount) {
-      return null;
-    }
-    if (isComputeSuperstep()) {
-      return new SuperstepProgress(currentSuperstep, verticesComputed,
-          verticesToCompute);
-    }
-    return null;
-  }
-
-  /**
    * Get string describing total job progress
    *
    * @return String describing total job progress

http://git-wip-us.apache.org/repos/asf/giraph/blob/93634eaf/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
index 9920750..a824107 100644
--- a/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
+++ b/giraph-core/src/main/java/org/apache/giraph/job/DefaultJobProgressTrackerService.java
@@ -107,10 +107,12 @@ public class DefaultJobProgressTrackerService
               break;
             }
 
-            if (!canFinishInTime(conf, job,
-                combinedWorkerProgress.getCurrentComputeSuperstepProgress(
-                    mappersStarted - 1))) {
-              killSlowJob();
+            if (!canFinishInTime(conf, job, mappersStarted - 1,
+                combinedWorkerProgress)) {
+              killJobWithMessage("Killing the job because it won't " +
+                "complete in max allotted time: " +
+                GiraphConstants.MAX_ALLOWED_JOB_TIME_MS.get(conf) / 1000 +
+                "s");
             }
 
             if (lastProgress == null ||
@@ -135,14 +137,15 @@ public class DefaultJobProgressTrackerService
   }
 
   /**
-   * Determine if the job will finish in allotted time.
+   * Determine if the job will finish in allotted time
    * @param conf Giraph configuration
    * @param job Job
-   * @param progress Current superstep progress.
-   * @return true it the job can finish in allotted time, false otherwise.
+   * @param workerCount Worker count
+   * @param progress Combined worker progress
+   * @return true it the job can finish in allotted time, false otherwise
    */
   protected boolean canFinishInTime(GiraphConfiguration conf, Job job,
-      SuperstepProgress progress) {
+      int workerCount, CombinedWorkerProgress progress) {
     // No defaut implementation.
     return true;
   }

http://git-wip-us.apache.org/repos/asf/giraph/blob/93634eaf/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java b/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
deleted file mode 100644
index 05e9077..0000000
--- a/giraph-core/src/main/java/org/apache/giraph/job/SuperstepProgress.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.giraph.job;
-
-/**
- * Class which contains worker progress for a given superstep
- *
- */
-public class SuperstepProgress {
-  /**
-  * Current superstep
-  */
-  private long currentSuperstep;
-
-  /**
-  * Total computed vertex count
-  */
-  private long computedVertexCount;
-
-  /**
-  * Total vertex count
-  */
-  private long totalVertexCount;
-
-  /**
-  * Timestamp when this progress was created
-  */
-  private long timestamp;
-
-  /**
-   * Constructor
-   * @param currentSuperstep Current superstep
-   * @param computedVertexCount Computed vertex count
-   * @param totalVertexCount Total vertex count
-   */
-  public SuperstepProgress(long currentSuperstep, long computedVertexCount,
-      long totalVertexCount) {
-    this.currentSuperstep = currentSuperstep;
-    this.computedVertexCount = computedVertexCount;
-    this.totalVertexCount = totalVertexCount;
-    this.timestamp = System.currentTimeMillis();
-  }
-
-  /**
-   * Get current superstep
-   * @return current superstep
-   */
-  public long getCurrentSuperstep() {
-    return currentSuperstep;
-  }
-
-  /**
-   * Get computed vertex count
-   * @return Computed vertex count
-   */
-  public long getComputedVertexCount() {
-    return computedVertexCount;
-  }
-
-  /**
-   * Get total vertex count.
-   * @return total vertex count
-   */
-  public long getTotalVertexCount() {
-    return totalVertexCount;
-  }
-
-  /**
-   * Get timestamp
-   * @return timestamp of this progress
-   */
-  public long getTimestamp() {
-    return timestamp;
-  }
-}
-