Search in sources :

Example 21 with ProcessorDescriptor

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

the class DagUtils method createPreWarmVertex.

/**
 * @param numContainers number of containers to pre-warm
 * @param localResources additional resources to pre-warm with
 * @return prewarm vertex to run
 */
public PreWarmVertex createPreWarmVertex(TezConfiguration conf, int numContainers, Map<String, LocalResource> localResources) throws IOException, TezException {
    ProcessorDescriptor prewarmProcDescriptor = ProcessorDescriptor.create(HivePreWarmProcessor.class.getName());
    prewarmProcDescriptor.setUserPayload(TezUtils.createUserPayloadFromConf(conf));
    PreWarmVertex prewarmVertex = PreWarmVertex.create("prewarm", prewarmProcDescriptor, numContainers, getContainerResource(conf));
    Map<String, LocalResource> combinedResources = new HashMap<String, LocalResource>();
    if (localResources != null) {
        combinedResources.putAll(localResources);
    }
    prewarmVertex.addTaskLocalFiles(localResources);
    prewarmVertex.setTaskLaunchCmdOpts(getContainerJavaOpts(conf));
    prewarmVertex.setTaskEnvironment(getContainerEnvironment(conf, false));
    return prewarmVertex;
}
Also used : PreWarmVertex(org.apache.tez.dag.api.PreWarmVertex) LinkedHashMap(java.util.LinkedHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ProcessorDescriptor(org.apache.tez.dag.api.ProcessorDescriptor) LocalResource(org.apache.hadoop.yarn.api.records.LocalResource)

Example 22 with ProcessorDescriptor

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

Aggregations

ProcessorDescriptor (org.apache.tez.dag.api.ProcessorDescriptor)22 TaskSpec (org.apache.tez.runtime.api.impl.TaskSpec)10 Test (org.junit.Test)10 Configuration (org.apache.hadoop.conf.Configuration)8 TezTaskAttemptID (org.apache.tez.dag.records.TezTaskAttemptID)8 InputSpec (org.apache.tez.runtime.api.impl.InputSpec)8 OutputSpec (org.apache.tez.runtime.api.impl.OutputSpec)8 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)6 ByteBuffer (java.nio.ByteBuffer)5 HashMap (java.util.HashMap)5 TezTaskID (org.apache.tez.dag.records.TezTaskID)5 DefaultHadoopShim (org.apache.tez.hadoop.shim.DefaultHadoopShim)5 ArrayList (java.util.ArrayList)4 Path (org.apache.hadoop.fs.Path)4 InputDescriptor (org.apache.tez.dag.api.InputDescriptor)4 OutputDescriptor (org.apache.tez.dag.api.OutputDescriptor)4 UserPayload (org.apache.tez.dag.api.UserPayload)4 LogicalIOProcessorRuntimeTask (org.apache.tez.runtime.LogicalIOProcessorRuntimeTask)4 GroupInputSpec (org.apache.tez.runtime.api.impl.GroupInputSpec)4 TezSharedExecutor (org.apache.tez.common.TezSharedExecutor)3