/** * Marks the Task as running, and sends scheduling message to the executor. * @param task the task to run */ public void onTaskScheduled(final Task task) { (task.getPropertyValue(ResourceSlotProperty.class).orElse(true) ? runningComplyingTasks : runningNonComplyingTasks).put(task.getTaskId(), task); runningTaskToAttempt.put(task, task.getAttemptIdx()); failedTasks.remove(task); serializationExecutorService.execute(() -> { final byte[] serialized = SerializationUtils.serialize(task); sendControlMessage( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.ScheduleTask) .setScheduleTaskMsg( ControlMessage.ScheduleTaskMsg.newBuilder() .setTask(ByteString.copyFrom(serialized)) .build()) .build()); }); }
/** * Marks the Task as running, and sends scheduling message to the executor. * @param task the task to run */ public void onTaskScheduled(final Task task) { (task.getPropertyValue(ResourceSlotProperty.class).orElse(true) ? runningComplyingTasks : runningNonComplyingTasks).put(task.getTaskId(), task); runningTaskToAttempt.put(task, task.getAttemptIdx()); failedTasks.remove(task); serializationExecutorService.execute(() -> { final byte[] serialized = SerializationUtils.serialize(task); sendControlMessage( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.ScheduleTask) .setScheduleTaskMsg( ControlMessage.ScheduleTaskMsg.newBuilder() .setTask(ByteString.copyFrom(serialized)) .build()) .build()); }); }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.ScheduleTaskMsg other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.ScheduleTaskMsg.getDefaultInstance()) return this; if (other.hasTask()) { setTask(other.getTask()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.ScheduleTaskMsg other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.ScheduleTaskMsg.getDefaultInstance()) return this; if (other.hasTask()) { setTask(other.getTask()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }