/** * 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()); }); }
/** * 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()); }); }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg.getDefaultInstance()) return this; if (other.hasRequestId()) { setRequestId(other.getRequestId()); } if (other.hasBlockId()) { bitField0_ |= 0x00000002; blockId_ = other.blockId_; onChanged(); } if (other.hasState()) { setState(other.getState()); } if (other.hasOwnerExecutorId()) { bitField0_ |= 0x00000008; ownerExecutorId_ = other.ownerExecutorId_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg other) { if (other == org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg.getDefaultInstance()) return this; if (other.hasRequestId()) { setRequestId(other.getRequestId()); } if (other.hasBlockId()) { bitField0_ |= 0x00000002; blockId_ = other.blockId_; onChanged(); } if (other.hasState()) { setState(other.getState()); } if (other.hasOwnerExecutorId()) { bitField0_ |= 0x00000008; ownerExecutorId_ = other.ownerExecutorId_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }