/** * <code>optional .protobuf.BlockLocationInfoMsg blockLocationInfoMsg = 9;</code> */ public Builder setBlockLocationInfoMsg( org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg.Builder builderForValue) { if (blockLocationInfoMsgBuilder_ == null) { blockLocationInfoMsg_ = builderForValue.build(); onChanged(); } else { blockLocationInfoMsgBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000100; return this; } /**
/** * <code>optional .protobuf.BlockLocationInfoMsg blockLocationInfoMsg = 9;</code> */ public Builder setBlockLocationInfoMsg( org.apache.nemo.runtime.common.comm.ControlMessage.BlockLocationInfoMsg.Builder builderForValue) { if (blockLocationInfoMsgBuilder_ == null) { blockLocationInfoMsg_ = builderForValue.build(); onChanged(); } else { blockLocationInfoMsgBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000100; return this; } /**
/** * 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()); }); }