public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitControl.CustomMessage message) throws java.io.IOException { if(message.hasType()) output.writeInt32(1, message.getType(), false); if(message.hasMessage()) output.writeByteArray(2, message.getMessage().toByteArray(), false); } public boolean isInitialized(org.apache.drill.exec.proto.BitControl.CustomMessage message)
public RECEIVE get(long timeout, TimeUnit unit) throws Exception, InvalidProtocolBufferException { CustomMessage message = future.checkedGet(timeout, unit); return serde.deserializeReceived(message.getMessage().toByteArray()); }
public RECEIVE get() throws Exception { CustomMessage message = future.checkedGet(); return serde.deserializeReceived(message.getMessage().toByteArray()); }
public Response handle(CustomMessage message, DrillBuf dBody) throws RpcException { final ParsingHandler<?, ?> handler; try (@SuppressWarnings("unused") Closeable lock = read.open()) { handler = handlers.get(message.getType()); } if (handler == null) { throw new UserRpcException( endpoint, "Unable to handle message.", new IllegalStateException(String.format( "Unable to handle message. The message type provided [%d] did not have a registered handler.", message.getType()))); } final CustomResponse<?> customResponse = handler.onMessage(message.getMessage(), dBody); @SuppressWarnings("unchecked") final CustomMessage responseMessage = CustomMessage.newBuilder() .setMessage( ByteString.copyFrom(((Controller.CustomSerDe<Object>) handler.getResponseSerDe()) .serializeToSend(customResponse .getMessage()))) .setType(message.getType()) .build(); // make sure we don't pass in a null array. final ByteBuf[] dBodies = customResponse.getBodies() == null ? new DrillBuf[0] : customResponse.getBodies(); return new Response(RpcType.RESP_CUSTOM, responseMessage, dBodies); }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitControl.CustomMessage message) throws java.io.IOException { if(message.hasType()) output.writeInt32(1, message.getType(), false); if(message.hasMessage()) output.writeByteArray(2, message.getMessage().toByteArray(), false); } public boolean isInitialized(org.apache.drill.exec.proto.BitControl.CustomMessage message)
/** * <code>optional bytes message = 2;</code> */ public Builder clearMessage() { bitField0_ = (bitField0_ & ~0x00000002); message_ = getDefaultInstance().getMessage(); onChanged(); return this; }
public Builder mergeFrom(org.apache.drill.exec.proto.BitControl.CustomMessage other) { if (other == org.apache.drill.exec.proto.BitControl.CustomMessage.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasMessage()) { setMessage(other.getMessage()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.drill.exec.proto.BitControl.CustomMessage other) { if (other == org.apache.drill.exec.proto.BitControl.CustomMessage.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasMessage()) { setMessage(other.getMessage()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional bytes message = 2;</code> */ public Builder clearMessage() { bitField0_ = (bitField0_ & ~0x00000002); message_ = getDefaultInstance().getMessage(); onChanged(); return this; }