Search in sources :

Example 1 with EntityDescriptorProto

use of org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto in project hive by apache.

the class Converters method convertToProto.

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();
}
Also used : UserPayload(org.apache.tez.dag.api.UserPayload) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException) IOException(java.io.IOException) UserPayloadProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.UserPayloadProto) EntityDescriptorProto(org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto)

Aggregations

IOException (java.io.IOException)1 EntityDescriptorProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto)1 UserPayloadProto (org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.UserPayloadProto)1 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)1 UserPayload (org.apache.tez.dag.api.UserPayload)1