org.apache.tez.dag.api
Interface VertexManagerPluginContext


public interface VertexManagerPluginContext

Object with API's to interact with the Tez execution engine


Method Summary
 void addRootInputEvents(String inputName, Collection<RootInputDataInformationEvent> events)
          Allows a VertexManagerPlugin to assign Events for Root Inputs For regular Event Routing changes - the EdgeManager should be configured via the setVertexParallelism method
 int getDAGAttemptNumber()
           
 Map<String,EdgeProperty> getInputVertexEdgeProperties()
          Get the edge properties on the input edges of this vertex.
 int getNumClusterNodes()
          Get the number of nodes in the cluster
 org.apache.hadoop.yarn.api.records.Resource getTotalAVailableResource()
          Get the total resource allocated to this vertex.
 byte[] getUserPayload()
          Get the payload set for the plugin
 Set<String> getVertexInputNames()
          Get the names of the non-vertex inputs of this vertex.
 String getVertexName()
          Get the name of the vertex
 int getVertexNumTasks(String vertexName)
          Get the number of tasks in the given vertex
 org.apache.hadoop.yarn.api.records.Resource getVertexTaskResource()
          Get the resource allocated to a task of this vertex
 void scheduleVertexTasks(List<Integer> taskIDs)
          Notify the vertex to start the given tasks
 void setVertexLocationHint(VertexLocationHint locationHint)
          Set the placement hint for tasks in this vertex
 boolean setVertexParallelism(int parallelism, VertexLocationHint locationHint, Map<String,EdgeManagerDescriptor> sourceEdgeManagers)
          Set the new parallelism (number of tasks) of this vertex.
 

Method Detail

getInputVertexEdgeProperties

Map<String,EdgeProperty> getInputVertexEdgeProperties()
Get the edge properties on the input edges of this vertex. The input edge is represented by the source vertex name

Returns:
Map of source vertex name and edge property

getVertexName

String getVertexName()
Get the name of the vertex

Returns:
Vertex name

getUserPayload

byte[] getUserPayload()
Get the payload set for the plugin

Returns:
user payload

getVertexNumTasks

int getVertexNumTasks(String vertexName)
Get the number of tasks in the given vertex

Parameters:
vertexName -
Returns:
Total number of tasks in this vertex

getVertexTaskResource

org.apache.hadoop.yarn.api.records.Resource getVertexTaskResource()
Get the resource allocated to a task of this vertex

Returns:
Resource

getTotalAVailableResource

org.apache.hadoop.yarn.api.records.Resource getTotalAVailableResource()
Get the total resource allocated to this vertex. If the DAG is running in a busy cluster then it may have no resources available dedicated to it. The DAG may divide its available resource among member vertices.

Returns:
Resource

getNumClusterNodes

int getNumClusterNodes()
Get the number of nodes in the cluster

Returns:
Number of nodes

setVertexParallelism

boolean setVertexParallelism(int parallelism,
                             VertexLocationHint locationHint,
                             Map<String,EdgeManagerDescriptor> sourceEdgeManagers)
Set the new parallelism (number of tasks) of this vertex. Map of source (input) vertices and edge managers to change the event routing between the source tasks and the new destination tasks. This API can change the parallelism only once. Subsequent attempts will be disallowed

Parameters:
parallelism - New number of tasks in the vertex
locationHint - the placement policy for tasks.
sourceEdgeManagers - Edge Managers to be updated
Returns:
true if the operation was allowed.

addRootInputEvents

void addRootInputEvents(String inputName,
                        Collection<RootInputDataInformationEvent> events)
Allows a VertexManagerPlugin to assign Events for Root Inputs For regular Event Routing changes - the EdgeManager should be configured via the setVertexParallelism method

Parameters:
inputName - The input name associated with the event
events - The list of Events to be assigned to various tasks belonging to the Vertex. The target index on individual events represents the task to which events need to be sent.

scheduleVertexTasks

void scheduleVertexTasks(List<Integer> taskIDs)
Notify the vertex to start the given tasks

Parameters:
taskIDs - Indices of the tasks to be started

getVertexInputNames

Set<String> getVertexInputNames()
Get the names of the non-vertex inputs of this vertex. These are primary sources of data.

Returns:
Names of inputs to this vertex. Maybe null if there are no inputs

setVertexLocationHint

void setVertexLocationHint(VertexLocationHint locationHint)
Set the placement hint for tasks in this vertex

Parameters:
locationHint -

getDAGAttemptNumber

int getDAGAttemptNumber()
Returns:
DAG Attempt number


Copyright © 2014 Apache Software Foundation. All rights reserved.