final RpcHeader header = RpcHeader.parseDelimitedFrom(is); InboundRpcMessage m = new InboundRpcMessage(header.getMode(), header.getRpcType(), header.getCoordinationId(), pBody, dBody);
RpcHeader header = RpcHeader.newBuilder() // int headerLength = header.getSerializedSize(); int protoBodyLength = msg.pBody.getSerializedSize(); int rawBodyLength = msg.getRawBodySize(); header.writeTo(cos);
/** * <code>optional .exec.rpc.RpcHeader header = 1;</code> * * <pre> * required * </pre> */ public Builder mergeHeader(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader value) { if (headerBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && header_ != org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance()) { header_ = org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.newBuilder(header_).mergeFrom(value).buildPartial(); } else { header_ = value; } onChanged(); } else { headerBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.GeneralRPCProtos.CompleteRpcMessage.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.setHeader(input.mergeObject(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.newBuilder(), org.apache.drill.exec.proto.SchemaGeneralRPCProtos.RpcHeader.MERGE)); break; case 2: builder.setProtobufBody(com.google.protobuf.ByteString.copyFrom(input.readByteArray())); break; case 3: builder.setRawBody(com.google.protobuf.ByteString.copyFrom(input.readByteArray())); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(org.apache.drill.exec.proto.GeneralRPCProtos.CompleteRpcMessage.Builder builder)
/** * <code>optional .exec.rpc.RpcHeader header = 1;</code> * * <pre> * required * </pre> */ public Builder mergeHeader(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader value) { if (headerBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && header_ != org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance()) { header_ = org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.newBuilder(header_).mergeFrom(value).buildPartial(); } else { header_ = value; } onChanged(); } else { headerBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, mode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, coordinationId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, rpcType_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader buildPartial() { org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader result = new org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.mode_ = mode_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.coordinationId_ = coordinationId_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.rpcType_ = rpcType_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * <code>optional .exec.rpc.RpcHeader header = 1;</code> * * <pre> * required * </pre> */ public Builder clearHeader() { if (headerBuilder_ == null) { header_ = org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance(); onChanged(); } else { headerBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); return this; } /**
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader prototype) {
public Builder clear() { super.clear(); if (headerBuilder_ == null) { header_ = org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance(); } else { headerBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); protobufBody_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); rawBody_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); return this; }
public org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader getDefaultInstanceForType() { return org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, mode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, coordinationId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, rpcType_); } getUnknownFields().writeTo(output); }
public static Builder newBuilder(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public Builder mergeFrom(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader other) { if (other == org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance()) return this; if (other.hasMode()) { setMode(other.getMode()); } if (other.hasCoordinationId()) { setCoordinationId(other.getCoordinationId()); } if (other.hasRpcType()) { setRpcType(other.getRpcType()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.Builder newMessage() { return org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.newBuilder(); } public java.lang.String getFieldName(int number)
private void initFields() { header_ = org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.getDefaultInstance(); protobufBody_ = com.google.protobuf.ByteString.EMPTY; rawBody_ = com.google.protobuf.ByteString.EMPTY; } private byte memoizedIsInitialized = -1;
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader message) throws java.io.IOException { if(message.hasMode()) output.writeEnum(1, message.getMode().getNumber(), false); if(message.hasCoordinationId()) output.writeInt32(2, message.getCoordinationId(), false); if(message.hasRpcType()) output.writeInt32(3, message.getRpcType(), false); } public boolean isInitialized(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader message)
public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.GeneralRPCProtos.CompleteRpcMessage.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.setHeader(input.mergeObject(org.apache.drill.exec.proto.GeneralRPCProtos.RpcHeader.newBuilder(), org.apache.drill.exec.proto.SchemaGeneralRPCProtos.RpcHeader.MERGE)); break; case 2: builder.setProtobufBody(com.google.protobuf.ByteString.copyFrom(input.readByteArray())); break; case 3: builder.setRawBody(com.google.protobuf.ByteString.copyFrom(input.readByteArray())); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(org.apache.drill.exec.proto.GeneralRPCProtos.CompleteRpcMessage.Builder builder)
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, mode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, coordinationId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, rpcType_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }