@Override public void onMessageWithContext(final ControlMessage.Message message, final MessageContext messageContext) { switch (message.getType()) { case RequestPipeLoc: final ControlMessage.RequestPipeLocationMessage pipeLocRequest = message.getRequestPipeLocMsg(); ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.PipeLocInfo) .setPipeLocInfoMsg(ControlMessage.PipeLocationInfoMessage.newBuilder() .setRequestId(message.getId()) .setExecutorId(location) .build()) throw new IllegalMessageException(new Exception(message.toString()));
@Override public void onMessage(final ControlMessage.Message message) { try { switch (message.getType()) { case BlockStateChanged: final ControlMessage.BlockStateChangedMsg blockStateChangedMsg = message.getBlockStateChangedMsg(); final String blockId = blockStateChangedMsg.getBlockId(); onBlockStateChanged(blockId, convertBlockState(blockStateChangedMsg.getState()), blockStateChangedMsg.getLocation()); break; default: throw new IllegalMessageException( new Exception("This message should not be received by " + BlockManagerMaster.class.getName() + ":" + message.getType())); } } catch (final Exception e) { throw new RuntimeException(e); } }
if (!hasType()) { memoizedIsInitialized = 0; return false; if (!hasId()) { memoizedIsInitialized = 0; return false; if (!hasListenerId()) { memoizedIsInitialized = 0; return false; if (hasTaskStateChangedMsg()) { if (!getTaskStateChangedMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasScheduleTaskMsg()) { if (!getScheduleTaskMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasBlockStateChangedMsg()) { if (!getBlockStateChangedMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasDataSizeMetricMsg()) { if (!getDataSizeMetricMsg().isInitialized()) {
ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) if (responseFromMaster.getType() != ControlMessage.MessageType.BlockLocationInfo) { throw new RuntimeException("Response message type mismatch!"); responseFromMaster.getBlockLocationInfoMsg(); if (!blockLocationInfoMsg.hasOwnerExecutorId()) { throw new BlockFetchException(new Throwable(
ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID) if (responseFromMaster.getType() != ControlMessage.MessageType.BlockLocationInfo) { throw new RuntimeException("Response message type mismatch!"); responseFromMaster.getBlockLocationInfoMsg(); if (!blockLocationInfoMsg.hasOwnerExecutorId()) { throw new BlockFetchException(new Throwable(
if (!hasType()) { memoizedIsInitialized = 0; return false; if (!hasId()) { memoizedIsInitialized = 0; return false; if (!hasListenerId()) { memoizedIsInitialized = 0; return false; if (hasTaskStateChangedMsg()) { if (!getTaskStateChangedMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasScheduleTaskMsg()) { if (!getScheduleTaskMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasBlockStateChangedMsg()) { if (!getBlockStateChangedMsg().isInitialized()) { memoizedIsInitialized = 0; return false; if (hasDataSizeMetricMsg()) { if (!getDataSizeMetricMsg().isInitialized()) {
} catch (final Exception e) { persistentConnectionToMasterMap.getMessageSender(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID).send( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID)
.send(ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID)
.send(ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID)
} catch (final Exception e) { persistentConnectionToMasterMap.getMessageSender(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID).send( ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.RUNTIME_MASTER_MESSAGE_LISTENER_ID)
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()); if (other.hasId()) { setId(other.getId()); if (other.hasListenerId()) { bitField0_ |= 0x00000004; listenerId_ = other.listenerId_; onChanged(); if (other.hasTaskStateChangedMsg()) { mergeTaskStateChangedMsg(other.getTaskStateChangedMsg()); if (other.hasScheduleTaskMsg()) { mergeScheduleTaskMsg(other.getScheduleTaskMsg()); if (other.hasBlockStateChangedMsg()) { mergeBlockStateChangedMsg(other.getBlockStateChangedMsg()); if (other.hasDataSizeMetricMsg()) { mergeDataSizeMetricMsg(other.getDataSizeMetricMsg()); if (other.hasRequestBlockLocationMsg()) { mergeRequestBlockLocationMsg(other.getRequestBlockLocationMsg()); if (other.hasBlockLocationInfoMsg()) { mergeBlockLocationInfoMsg(other.getBlockLocationInfoMsg());
ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID) if (responseFromMaster.getType() != ControlMessage.MessageType.PipeLocInfo) { throw new RuntimeException("Response message type mismatch!"); final ControlMessage.PipeLocationInfoMessage pipeLocInfo = responseFromMaster.getPipeLocInfoMsg(); if (!pipeLocInfo.hasExecutorId()) { throw new IllegalStateException(); final String targetExecutorId = responseFromMaster.getPipeLocInfoMsg().getExecutorId();
private void handleControlMessage(final ControlMessage.Message message) { switch (message.getType()) { case TaskStateChanged: final ControlMessage.TaskStateChangedMsg taskStateChangedMsg = message.getTaskStateChangedMsg(); final ControlMessage.ExecutorFailedMsg executorFailedMsg = message.getExecutorFailedMsg(); final String failedExecutorId = executorFailedMsg.getExecutorId(); final Exception exception = SerializationUtils.deserialize(executorFailedMsg.getException().toByteArray()); throw new RuntimeException(exception); case DataSizeMetric: ((BatchScheduler) scheduler).updateDynOptData(message.getDataSizeMetricMsg().getPartitionSizeList()); break; case MetricMessageReceived: final List<ControlMessage.Metric> metricList = message.getMetricMsg().getMetricList(); metricList.forEach(metric -> metricMessageHandler.onMetricMessageReceived( break; case ExecutorDataCollected: final String serializedData = message.getDataCollected().getData(); clientRPC.send(ControlMessage.DriverToClientMessage.newBuilder() .setType(ControlMessage.DriverToClientMessageType.DataCollected) default: throw new IllegalMessageException( new Exception("This message should not be received by Master :" + message.getType()));
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()); if (other.hasId()) { setId(other.getId()); if (other.hasListenerId()) { bitField0_ |= 0x00000004; listenerId_ = other.listenerId_; onChanged(); if (other.hasTaskStateChangedMsg()) { mergeTaskStateChangedMsg(other.getTaskStateChangedMsg()); if (other.hasScheduleTaskMsg()) { mergeScheduleTaskMsg(other.getScheduleTaskMsg()); if (other.hasBlockStateChangedMsg()) { mergeBlockStateChangedMsg(other.getBlockStateChangedMsg()); if (other.hasDataSizeMetricMsg()) { mergeDataSizeMetricMsg(other.getDataSizeMetricMsg()); if (other.hasRequestBlockLocationMsg()) { mergeRequestBlockLocationMsg(other.getRequestBlockLocationMsg()); if (other.hasBlockLocationInfoMsg()) { mergeBlockLocationInfoMsg(other.getBlockLocationInfoMsg());
ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID) if (responseFromMaster.getType() != ControlMessage.MessageType.PipeLocInfo) { throw new RuntimeException("Response message type mismatch!"); final ControlMessage.PipeLocationInfoMessage pipeLocInfo = responseFromMaster.getPipeLocInfoMsg(); if (!pipeLocInfo.hasExecutorId()) { throw new IllegalStateException(); final String targetExecutorId = responseFromMaster.getPipeLocInfoMsg().getExecutorId();
private void handleControlMessage(final ControlMessage.Message message) { switch (message.getType()) { case TaskStateChanged: final ControlMessage.TaskStateChangedMsg taskStateChangedMsg = message.getTaskStateChangedMsg(); final ControlMessage.ExecutorFailedMsg executorFailedMsg = message.getExecutorFailedMsg(); final String failedExecutorId = executorFailedMsg.getExecutorId(); final Exception exception = SerializationUtils.deserialize(executorFailedMsg.getException().toByteArray()); throw new RuntimeException(exception); case DataSizeMetric: ((BatchScheduler) scheduler).updateDynOptData(message.getDataSizeMetricMsg().getPartitionSizeList()); break; case MetricMessageReceived: final List<ControlMessage.Metric> metricList = message.getMetricMsg().getMetricList(); metricList.forEach(metric -> metricMessageHandler.onMetricMessageReceived( break; case ExecutorDataCollected: final String serializedData = message.getDataCollected().getData(); clientRPC.send(ControlMessage.DriverToClientMessage.newBuilder() .setType(ControlMessage.DriverToClientMessageType.DataCollected) default: throw new IllegalMessageException( new Exception("This message should not be received by Master :" + message.getType()));
.send(ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID)
assert (message.getType() == ControlMessage.MessageType.RequestBlockLocation); final String blockIdWildcard = message.getRequestBlockLocationMsg().getBlockIdWildcard(); final long requestId = message.getId(); final Lock readLock = lock.readLock(); readLock.lock();
@Override public void onMessageWithContext(final ControlMessage.Message message, final MessageContext messageContext) { switch (message.getType()) { case RequestPipeLoc: final ControlMessage.RequestPipeLocationMessage pipeLocRequest = message.getRequestPipeLocMsg(); ControlMessage.Message.newBuilder() .setId(RuntimeIdManager.generateMessageId()) .setListenerId(MessageEnvironment.EXECUTOR_MESSAGE_LISTENER_ID) .setType(ControlMessage.MessageType.PipeLocInfo) .setPipeLocInfoMsg(ControlMessage.PipeLocationInfoMessage.newBuilder() .setRequestId(message.getId()) .setExecutorId(location) .build()) throw new IllegalMessageException(new Exception(message.toString()));
assert (message.getType() == ControlMessage.MessageType.RequestBlockLocation); final String blockIdWildcard = message.getRequestBlockLocationMsg().getBlockIdWildcard(); final long requestId = message.getId(); final Lock readLock = lock.readLock(); readLock.lock();