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:38:53 UTC
git commit: updated refs/heads/trunk to d4db3a6
Repository: giraph
Updated Branches:
refs/heads/trunk 448ae1c06 -> d4db3a650
GIRAPH-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/d4db3a65
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/d4db3a65
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/d4db3a65
Branch: refs/heads/trunk
Commit: d4db3a650fa40ee89513ff581653dbe2d44cb671
Parents: 448ae1c
Author: Maja Kabiljo <ma...@fb.com>
Authored: Fri Sep 15 11:37:58 2017 -0700
Committer: Maja Kabiljo <ma...@fb.com>
Committed: Fri Sep 15 11:37:58 2017 -0700
----------------------------------------------------------------------
.../giraph/job/CombinedWorkerProgress.java | 33 +++++++++++++++++++-
.../job/DefaultJobProgressTrackerService.java | 20 ++++++++++++
2 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/d4db3a65/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..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
@@ -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
@@ -144,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 getWorkersInSuperstep() {
+ 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
http://git-wip-us.apache.org/repos/asf/giraph/blob/d4db3a65/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..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,6 +107,13 @@ public class DefaultJobProgressTrackerService
break;
}
+ 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 +
+ "s");
+ }
+
if (lastProgress == null ||
combinedWorkerProgress.madeProgressFrom(lastProgress)) {
lastProgress = combinedWorkerProgress;
@@ -129,6 +136,19 @@ public class DefaultJobProgressTrackerService
}
/**
+ * Determine if the job will finish in allotted time
+ * @param conf Giraph configuration
+ * @param job Job
+ * @param progress Combined worker progress
+ * @return true it the job can finish in allotted time, false otherwise
+ */
+ protected boolean canFinishInTime(GiraphConfiguration conf, Job job,
+ CombinedWorkerProgress progress) {
+ // No defaut implementation.
+ return true;
+ }
+
+ /**
* Kill job with message describing why it's being killed
*
* @param message Message describing why job is being killed