johnyangk commented on a change in pull request #72: [Nemo-59] Skewed
data-aware executor allocation
URL: https://github.com/apache/incubator-nemo/pull/72#discussion_r200859832
##########
File path:
runtime/master/src/main/java/edu/snu/nemo/runtime/master/resource/ExecutorRepresenter.java
##########
@@ -133,19 +136,41 @@ public void sendControlMessage(final
ControlMessage.Message message) {
*
*/
public void onTaskExecutionComplete(final String taskId) {
- runningTasks.remove(taskId);
- runningTaskToAttempt.remove(taskId);
- completeTasks.add(taskId);
+ Task completedTask = null;
+ for (Task task : runningTasks) {
+ if (task.getTaskId().equals(taskId)) {
+ completedTask = task;
+ }
+ }
+
+ if (completedTask == null) {
+ throw new RuntimeException("Completed task not found in its
ExecutorRepresenter");
+ }
+
+ runningTasks.remove(completedTask);
Review comment:
Replace L139-L148 with the following? (using the Java Collection interface,
instead of manually looping through the collection)
if (!runningTasks.remove(completedTask)) {
throw new RuntimeException("Completed task not found in its
ExecutorRepresenter");
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services