Search in sources :

Example 6 with UserPayload

use of org.apache.tez.dag.api.UserPayload 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)

Example 7 with UserPayload

use of org.apache.tez.dag.api.UserPayload in project hive by apache.

the class Converters method convertInputDescriptorFromProto.

private static InputDescriptor convertInputDescriptorFromProto(EntityDescriptorProto proto) {
    String className = proto.getClassName();
    UserPayload payload = convertPayloadFromProto(proto);
    InputDescriptor id = InputDescriptor.create(className);
    setUserPayload(id, payload);
    return id;
}
Also used : InputDescriptor(org.apache.tez.dag.api.InputDescriptor) UserPayload(org.apache.tez.dag.api.UserPayload) ByteString(com.google.protobuf.ByteString)

Example 8 with UserPayload

use of org.apache.tez.dag.api.UserPayload in project hive by apache.

the class LlapTaskCommunicator method extractQueryId.

private String extractQueryId(TaskSpec taskSpec) throws IOException {
    UserPayload processorPayload = taskSpec.getProcessorDescriptor().getUserPayload();
    Configuration conf = TezUtils.createConfFromUserPayload(processorPayload);
    return HiveConf.getVar(conf, HiveConf.ConfVars.HIVEQUERYID);
}
Also used : UserPayload(org.apache.tez.dag.api.UserPayload) Configuration(org.apache.hadoop.conf.Configuration) TezConfiguration(org.apache.tez.dag.api.TezConfiguration)

Example 9 with UserPayload

use of org.apache.tez.dag.api.UserPayload in project hive by apache.

the class Converters method convertProcessorDescriptorFromProto.

private static ProcessorDescriptor convertProcessorDescriptorFromProto(EntityDescriptorProto proto) {
    String className = proto.getClassName();
    UserPayload payload = convertPayloadFromProto(proto);
    ProcessorDescriptor pd = ProcessorDescriptor.create(className);
    setUserPayload(pd, payload);
    return pd;
}
Also used : UserPayload(org.apache.tez.dag.api.UserPayload) ProcessorDescriptor(org.apache.tez.dag.api.ProcessorDescriptor) ByteString(com.google.protobuf.ByteString)

Example 10 with UserPayload

use of org.apache.tez.dag.api.UserPayload in project hive by apache.

the class DagUtils method setupAutoReducerParallelism.

private void setupAutoReducerParallelism(TezEdgeProperty edgeProp, Vertex v) throws IOException {
    if (edgeProp.isAutoReduce()) {
        Configuration pluginConf = new Configuration(false);
        VertexManagerPluginDescriptor desc = VertexManagerPluginDescriptor.create(ShuffleVertexManager.class.getName());
        pluginConf.setBoolean(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_ENABLE_AUTO_PARALLEL, true);
        pluginConf.setInt(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_MIN_TASK_PARALLELISM, edgeProp.getMinReducer());
        pluginConf.setLong(ShuffleVertexManager.TEZ_SHUFFLE_VERTEX_MANAGER_DESIRED_TASK_INPUT_SIZE, edgeProp.getInputSizePerReducer());
        UserPayload payload = TezUtils.createUserPayloadFromConf(pluginConf);
        desc.setUserPayload(payload);
        v.setVertexManagerPlugin(desc);
    }
}
Also used : ShuffleVertexManager(org.apache.tez.dag.library.vertexmanager.ShuffleVertexManager) Configuration(org.apache.hadoop.conf.Configuration) TezConfiguration(org.apache.tez.dag.api.TezConfiguration) TezRuntimeConfiguration(org.apache.tez.runtime.library.api.TezRuntimeConfiguration) UserPayload(org.apache.tez.dag.api.UserPayload) VertexManagerPluginDescriptor(org.apache.tez.dag.api.VertexManagerPluginDescriptor)

Aggregations

UserPayload (org.apache.tez.dag.api.UserPayload)12 ByteString (com.google.protobuf.ByteString)4 IOException (java.io.IOException)4 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)3 HashMap (java.util.HashMap)2 Configuration (org.apache.hadoop.conf.Configuration)2 LocalResource (org.apache.hadoop.yarn.api.records.LocalResource)2 InputDescriptor (org.apache.tez.dag.api.InputDescriptor)2 OutputDescriptor (org.apache.tez.dag.api.OutputDescriptor)2 ProcessorDescriptor (org.apache.tez.dag.api.ProcessorDescriptor)2 Test (org.junit.Test)2 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)1 HashMultimap (com.google.common.collect.HashMultimap)1 LinkedListMultimap (com.google.common.collect.LinkedListMultimap)1 Multimap (com.google.common.collect.Multimap)1 FileNotFoundException (java.io.FileNotFoundException)1 URISyntaxException (java.net.URISyntaxException)1 ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1