.getMessageSender(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID).request( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.RequestBlockLocation) .setRequestBlockLocationMsg( ControlMessage.RequestBlockLocationMsg.newBuilder() .setExecutorId(executorId) .setBlockIdWildcard(blockIdWildcard) .build()) .build()); return responseFromMasterFuture; });
/** * <code>optional .protobuf.BlockLocationInfoMsg blockLocationInfoMsg = 9;</code> */ public org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg.Builder getBlockLocationInfoMsgBuilder() { bitField0_ |= 0x00000100; onChanged(); return getBlockLocationInfoMsgFieldBuilder().getBuilder(); } /**
public final boolean isInitialized() { if (!hasType()) { if (!hasId()) { if (!hasListenerId()) { if (hasTaskStateChangedMsg()) { if (!getTaskStateChangedMsg().isInitialized()) { if (hasScheduleTaskMsg()) { if (!getScheduleTaskMsg().isInitialized()) { if (hasBlockStateChangedMsg()) { if (!getBlockStateChangedMsg().isInitialized()) { if (hasDataSizeMetricMsg()) { if (!getDataSizeMetricMsg().isInitialized()) { if (hasRequestBlockLocationMsg()) { if (!getRequestBlockLocationMsg().isInitialized()) { if (hasBlockLocationInfoMsg()) { if (!getBlockLocationInfoMsg().isInitialized()) { if (hasExecutorFailedMsg()) { if (!getExecutorFailedMsg().isInitialized()) { if (hasContainerFailedMsg()) { if (!getContainerFailedMsg().isInitialized()) {
public final boolean isInitialized() { if (!hasType()) { if (!hasId()) { if (!hasListenerId()) { if (hasTaskStateChangedMsg()) { if (!getTaskStateChangedMsg().isInitialized()) { if (hasScheduleTaskMsg()) { if (!getScheduleTaskMsg().isInitialized()) { if (hasBlockStateChangedMsg()) { if (!getBlockStateChangedMsg().isInitialized()) { if (hasDataSizeMetricMsg()) { if (!getDataSizeMetricMsg().isInitialized()) { if (hasRequestBlockLocationMsg()) { if (!getRequestBlockLocationMsg().isInitialized()) { if (hasBlockLocationInfoMsg()) { if (!getBlockLocationInfoMsg().isInitialized()) { if (hasExecutorFailedMsg()) { if (!getExecutorFailedMsg().isInitialized()) { if (hasContainerFailedMsg()) { if (!getContainerFailedMsg().isInitialized()) {
.getMessageSender(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID).request( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.RequestBlockLocation) .setRequestBlockLocationMsg( ControlMessage.RequestBlockLocationMsg.newBuilder() .setExecutorId(executorId) .setBlockIdWildcard(blockIdWildcard) .build()) .build()); return responseFromMasterFuture; });
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.Message other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.Message.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); setId(other.getId()); onChanged(); mergeTaskStateChangedMsg(other.getTaskStateChangedMsg()); mergeScheduleTaskMsg(other.getScheduleTaskMsg()); mergeBlockStateChangedMsg(other.getBlockStateChangedMsg()); mergeDataSizeMetricMsg(other.getDataSizeMetricMsg()); mergeRequestBlockLocationMsg(other.getRequestBlockLocationMsg()); mergeBlockLocationInfoMsg(other.getBlockLocationInfoMsg()); mergeExecutorFailedMsg(other.getExecutorFailedMsg()); mergeContainerFailedMsg(other.getContainerFailedMsg()); mergeMetricMsg(other.getMetricMsg()); mergeDataCollected(other.getDataCollected()); mergeRequestbroadcastVariableMsg(other.getRequestbroadcastVariableMsg());
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.Message other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.Message.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); setId(other.getId()); onChanged(); mergeTaskStateChangedMsg(other.getTaskStateChangedMsg()); mergeScheduleTaskMsg(other.getScheduleTaskMsg()); mergeBlockStateChangedMsg(other.getBlockStateChangedMsg()); mergeDataSizeMetricMsg(other.getDataSizeMetricMsg()); mergeRequestBlockLocationMsg(other.getRequestBlockLocationMsg()); mergeBlockLocationInfoMsg(other.getBlockLocationInfoMsg()); mergeExecutorFailedMsg(other.getExecutorFailedMsg()); mergeContainerFailedMsg(other.getContainerFailedMsg()); mergeMetricMsg(other.getMetricMsg()); mergeDataCollected(other.getDataCollected()); mergeRequestbroadcastVariableMsg(other.getRequestbroadcastVariableMsg());
persistentConnectionToMasterMap.getMessageSender(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID).send( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.ExecutorFailed) .setExecutorFailedMsg(ControlMessage.ExecutorFailedMsg.newBuilder() .setExecutorId(executorId) .setException(ByteString.copyFrom(SerializationUtils.serialize(e))) .build()) .build()); throw e;
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.BlockStateChanged) .setBlockStateChangedMsg(blockStateChangedMsgBuilder.build()) .build());
persistentConnectionToMasterMap.getMessageSender(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID).send( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.ExecutorFailed) .setExecutorFailedMsg(ControlMessage.ExecutorFailedMsg.newBuilder() .setExecutorId(executorId) .setException(ByteString.copyFrom(SerializationUtils.serialize(e))) .build()) .build()); throw e;
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.BlockStateChanged) .setBlockStateChangedMsg(blockStateChangedMsgBuilder.build()) .build());
.getMessageSender(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID).request( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.RequestPipeLoc) .setRequestPipeLocMsg( ControlMessage.RequestPipeLocationMessage.newBuilder() .setExecutorId(executorId) .setSrcTaskIndex(srcTaskIndex) .build()) .build());
.getMessageSender(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID).request( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.RequestPipeLoc) .setRequestPipeLocMsg( ControlMessage.RequestPipeLocationMessage.newBuilder() .setExecutorId(executorId) .setSrcTaskIndex(srcTaskIndex) .build()) .build());
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.PipeLocInfo) .setPipeLocInfoMsg(ControlMessage.PipeLocationInfoMessage.newBuilder() .setRequestId(message.getId()) .setExecutorId(location) .build()) .build()); } catch (InterruptedException e) { throw new RuntimeException(e);
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.PipeLocInfo) .setPipeLocInfoMsg(ControlMessage.PipeLocationInfoMessage.newBuilder() .setRequestId(message.getId()) .setExecutorId(location) .build()) .build()); } catch (InterruptedException e) { throw new RuntimeException(e);
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.BlockStateChanged) .setBlockStateChangedMsg(blockStateChangedMsgBuilder) .build()); } else { throw new BlockFetchException(new Throwable("Cannot find corresponding block " + blockId));
/** * Notifies the change in task state to master. * @param newState of the task. * @param vertexPutOnHold the vertex put on hold. * @param cause only provided as non-empty upon recoverable failures. */ private void notifyTaskStateToMaster(final TaskState.State newState, final Optional<String> vertexPutOnHold, final Optional<TaskState.RecoverableTaskFailureCause> cause) { final ControlMessage.TaskStateChangedMsg.Builder msgBuilder = ControlMessage.TaskStateChangedMsg.newBuilder() .setExecutorId(executorId) .setTaskId(taskId) .setAttemptIdx(attemptIdx) .setState(convertState(newState)); if (vertexPutOnHold.isPresent()) { msgBuilder.setVertexPutOnHoldId(vertexPutOnHold.get()); } if (cause.isPresent()) { msgBuilder.setFailureCause(convertFailureCause(cause.get())); } // Send taskStateChangedMsg to master! persistentConnectionToMasterMap.getMessageSender(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID).send( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.TaskStateChanged) .setTaskStateChangedMsg(msgBuilder.build()) .build()); }
@Override public void onMessageWithContext(final ControlMessage.Message message, final MessageContext messageContext) { switch (message.getType()) { case RequestBroadcastVariable: final Serializable broadcastId = SerializationUtils.deserialize(message.getRequestbroadcastVariableMsg().getBroadcastId().toByteArray()); final Object broadcastVariable = BroadcastManagerMaster.getBroadcastVariable(broadcastId); if (broadcastVariable == null) { throw new IllegalStateException(broadcastId.toString()); } messageContext.reply( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.InMasterBroadcastVariable) .setBroadcastVariableMsg(ControlMessage.InMasterBroadcastVariableMessage.newBuilder() .setRequestId(message.getId()) // TODO #206: Efficient Broadcast Variable Serialization .setVariable(ByteString.copyFrom(SerializationUtils.serialize((Serializable) broadcastVariable))) .build()) .build()); break; default: throw new IllegalMessageException( new Exception("This message should not be requested to Master :" + message.getType())); } } }
.setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.BlockStateChanged) .setBlockStateChangedMsg(blockStateChangedMsgBuilder) .build()); } else { throw new BlockFetchException(new Throwable("Cannot find corresponding block " + blockId));
/** * Registers a request for the block location. * If the location is already known, reply the location instantly. * * @param requestId the ID of the block location request. * @param messageContext the message context to reply. */ void registerRequest(final long requestId, final MessageContext messageContext) { final ControlMessage.BlockLocationInfoMsg.Builder infoMsgBuilder = ControlMessage.BlockLocationInfoMsg.newBuilder() .setRequestId(requestId) .setBlockId(blockIdOrWildcard); locationFuture.whenComplete((location, throwable) -> { if (throwable == null) { infoMsgBuilder.setOwnerExecutorId(location); } else { infoMsgBuilder.setState( convertBlockState(((AbsentBlockException) throwable).getState())); } messageContext.reply( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.BlockLocationInfo) .setBlockLocationInfoMsg(infoMsgBuilder.build()) .build()); }); }