Skip to content
Permalink
Browse files
GIRAPH-1158
closes #47
  • Loading branch information
Maja Kabiljo committed Sep 15, 2017
1 parent 448ae1c commit d4db3a650fa40ee89513ff581653dbe2d44cb671
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
@@ -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
@@ -143,6 +142,38 @@ public CombinedWorkerProgress(Iterable<WorkerProgress> workerProgresses,
}
}

/**
* 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
*
@@ -107,6 +107,13 @@ public void run() {
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;
@@ -128,6 +135,19 @@ public void run() {
}, "progress-writer");
}

/**
* 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
*

0 comments on commit d4db3a6

Please sign in to comment.