private static EntityDescriptorProto convertToProto( EntityDescriptor<?> descriptor) { EntityDescriptorProto.Builder builder = EntityDescriptorProto .newBuilder(); builder.setClassName(descriptor.getClassName()); UserPayload userPayload = descriptor.getUserPayload(); if (userPayload != null) { UserPayloadProto.Builder payloadBuilder = UserPayloadProto.newBuilder(); if (userPayload.hasPayload()) { payloadBuilder.setUserPayload(ByteString.copyFrom(userPayload.getPayload())); payloadBuilder.setVersion(userPayload.getVersion()); } builder.setUserPayload(payloadBuilder.build()); } if (descriptor.getHistoryText() != null) { try { builder.setHistoryText(TezCommonUtils.compressByteArrayToByteString( descriptor.getHistoryText().getBytes("UTF-8"))); } catch (IOException e) { throw new TezUncheckedException(e); } } return builder.build(); }
public Builder mergeFrom(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto other) { if (other == org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto.getDefaultInstance()) return this; if (other.hasClassName()) { bitField0_ |= 0x00000001; className_ = other.className_; onChanged(); } if (other.hasUserPayload()) { mergeUserPayload(other.getUserPayload()); } if (other.hasHistoryText()) { setHistoryText(other.getHistoryText()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }