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_r200859841
##########
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);
+ runningTaskToAttempt.remove(completedTask);
+ completeTasks.add(completedTask);
}
/**
* Marks the specified Task as failed.
* @param taskId id of the Task
*/
public void onTaskExecutionFailed(final String taskId) {
- runningTasks.remove(taskId);
- runningTaskToAttempt.remove(taskId);
- failedTasks.add(taskId);
+ Task failedTask = null;
+ for (Task task : runningTasks) {
+ if (task.getTaskId().equals(taskId)) {
+ failedTask = task;
+ }
+ }
+
+ if (failedTask == null) {
+ throw new RuntimeException("Completed task not found in its
ExecutorRepresenter");
Review comment:
Ditto.
----------------------------------------------------------------
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