org.apache.tez.dag.api
Class Vertex

java.lang.Object
  extended by org.apache.tez.dag.api.Vertex

public class Vertex
extends Object


Constructor Summary
Vertex(String vertexName, ProcessorDescriptor processorDescriptor, int parallelism, org.apache.hadoop.yarn.api.records.Resource taskResource)
           
 
Method Summary
 Vertex addInput(String inputName, InputDescriptor inputDescriptor, Class<? extends TezRootInputInitializer> inputInitializer)
          Specifies an Input for a Vertex.
 Vertex addOutput(String outputName, OutputDescriptor outputDescriptor)
           
 Vertex addOutput(String outputName, OutputDescriptor outputDescriptor, Class<? extends OutputCommitter> outputCommitterClazz)
          Specifies an Output for a Vertex.
 List<Vertex> getInputVertices()
           
 String getJavaOpts()
           
 List<Vertex> getOutputVertices()
           
 int getParallelism()
           
 ProcessorDescriptor getProcessorDescriptor()
           
 Map<String,String> getTaskEnvironment()
           
 Map<String,org.apache.hadoop.yarn.api.records.LocalResource> getTaskLocalResources()
           
 org.apache.hadoop.yarn.api.records.Resource getTaskResource()
           
 String getVertexName()
           
 Vertex setJavaOpts(String javaOpts)
           
 Vertex setTaskEnvironment(Map<String,String> environment)
           
 Vertex setTaskLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources)
           
 Vertex setTaskLocationsHint(List<VertexLocationHint.TaskLocationHint> locations)
           
 Vertex setVertexManagerPlugin(VertexManagerPluginDescriptor vertexManagerPluginDescriptor)
          Specifies a VertexManagerPlugin for the vertex.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vertex

public Vertex(String vertexName,
              ProcessorDescriptor processorDescriptor,
              int parallelism,
              org.apache.hadoop.yarn.api.records.Resource taskResource)
Method Detail

getVertexName

public String getVertexName()

getProcessorDescriptor

public ProcessorDescriptor getProcessorDescriptor()

getParallelism

public int getParallelism()

getTaskResource

public org.apache.hadoop.yarn.api.records.Resource getTaskResource()

setTaskLocationsHint

public Vertex setTaskLocationsHint(List<VertexLocationHint.TaskLocationHint> locations)

setTaskLocalResources

public Vertex setTaskLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources)

getTaskLocalResources

public Map<String,org.apache.hadoop.yarn.api.records.LocalResource> getTaskLocalResources()

setTaskEnvironment

public Vertex setTaskEnvironment(Map<String,String> environment)

getTaskEnvironment

public Map<String,String> getTaskEnvironment()

setJavaOpts

public Vertex setJavaOpts(String javaOpts)

addInput

public Vertex addInput(String inputName,
                       InputDescriptor inputDescriptor,
                       Class<? extends TezRootInputInitializer> inputInitializer)
Specifies an Input for a Vertex. This is meant to be used when a Vertex reads Input directly from an external source

For vertices which read data generated by another vertex - use the addEdge method. If a vertex needs to use data generated by another vertex in the DAG and also from an external source, a combination of this API and the DAG.addEdge API can be used.

Parameters:
inputName - the name of the input. This will be used when accessing the input in the LogicalIOProcessor
inputDescriptor - the inputDescriptor for this input
inputInitializer - An initializer for this Input which may run within the AM. This can be used to set the parallelism for this vertex and generate RootInputDataInformationEvents for the actual Input.

If this is not specified, the parallelism must be set for the vertex. In addition, the Input should know how to access data for each of it's tasks.

If a TezRootInputInitializer is meant to determine the parallelism of the vertex, the initial vertex parallelism should be set to -1.
Returns:
this Vertex

addOutput

public Vertex addOutput(String outputName,
                        OutputDescriptor outputDescriptor,
                        Class<? extends OutputCommitter> outputCommitterClazz)
Specifies an Output for a Vertex. This is meant to be used when a Vertex writes Output directly to an external destination.

If an output of the vertex is meant to be consumed by another Vertex in the DAG - use the addEdge method. If a vertex needs generate data to an external source as well as for another Vertex in the DAG, a combination of this API and the DAG.addEdge API can be used.

Parameters:
outputName - the name of the output. This will be used when accessing the output in the LogicalIOProcessor
outputDescriptor -
outputCommitterClazz - Class to be used for the OutputCommitter. Can be null.
Returns:
this Vertex

addOutput

public Vertex addOutput(String outputName,
                        OutputDescriptor outputDescriptor)

setVertexManagerPlugin

public Vertex setVertexManagerPlugin(VertexManagerPluginDescriptor vertexManagerPluginDescriptor)
Specifies a VertexManagerPlugin for the vertex. This plugin can be used to modify the parallelism or reconfigure the vertex at runtime using user defined code embedded in the plugin

Parameters:
vertexManagerPluginDescriptor -
Returns:
this Vertex

getJavaOpts

public String getJavaOpts()

toString

public String toString()
Overrides:
toString in class Object

getInputVertices

public List<Vertex> getInputVertices()

getOutputVertices

public List<Vertex> getOutputVertices()


Copyright © 2014 Apache Software Foundation. All rights reserved.