@InterfaceStability.Unstable
@InterfaceAudience.Public
public interface VertexManagerPluginContext
Modifier and Type | Method and Description |
---|---|
void |
addRootInputEvents(String inputName,
Collection<InputDataInformationEvent> events)
Allows a VertexManagerPlugin to assign Events for Root Inputs
For regular Event Routing changes - the EdgeManager should be configured
via the setVertexParallelism method
|
void |
doneReconfiguringVertex()
Optional API.
|
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.Container |
getTaskContainer(String vertexName,
Integer taskIndex)
Get the container for the successful attempt of the task
|
org.apache.hadoop.yarn.api.records.Resource |
getTotalAvailableResource()
Get the total resource allocated to this vertex.
|
UserPayload |
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 |
registerForVertexStateUpdates(String vertexName,
Set<VertexState> stateSet)
Register to get notifications on updates to the specified vertex.
|
void |
scheduleVertexTasks(List<org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint> tasks)
Notify the vertex to start the given tasks
|
void |
setVertexLocationHint(VertexLocationHint locationHint)
Set the placement hint for tasks in this vertex
|
void |
setVertexParallelism(int parallelism,
VertexLocationHint locationHint,
Map<String,EdgeManagerPluginDescriptor> sourceEdgeManagers,
Map<String,InputSpecUpdate> rootInputSpecUpdate)
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 and the number of physical inputs for root inputs.
|
void |
vertexReconfigurationPlanned()
Optional API.
|
Map<String,EdgeProperty> getInputVertexEdgeProperties()
String getVertexName()
UserPayload getUserPayload()
int getVertexNumTasks(String vertexName)
vertexName
- org.apache.hadoop.yarn.api.records.Resource getVertexTaskResource()
org.apache.hadoop.yarn.api.records.Container getTaskContainer(String vertexName, Integer taskIndex)
org.apache.hadoop.yarn.api.records.Resource getTotalAvailableResource()
int getNumClusterNodes()
void setVertexParallelism(int parallelism, @Nullable VertexLocationHint locationHint, @Nullable Map<String,EdgeManagerPluginDescriptor> sourceEdgeManagers, @Nullable Map<String,InputSpecUpdate> rootInputSpecUpdate)
parallelism
- New number of tasks in the vertexlocationHint
- the placement policy for tasks.sourceEdgeManagers
- Edge Managers to be updatedrootInputSpecUpdate
- Updated Root Input specifications, if any.
If none specified, a default of 1 physical input is usedvoid addRootInputEvents(String inputName, Collection<InputDataInformationEvent> events)
inputName
- The input name associated with the eventevents
- 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.void scheduleVertexTasks(List<org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint> tasks)
tasks
- Indices of the tasks to be started@Nullable Set<String> getVertexInputNames()
void setVertexLocationHint(VertexLocationHint locationHint)
locationHint
- int getDAGAttemptNumber()
void registerForVertexStateUpdates(String vertexName, @Nullable Set<VertexState> stateSet)
VertexManagerPlugin.onVertexStateUpdated(org.apache.tez.dag.api.event.VertexStateUpdate)
This method can only be invoked once. Duplicate invocations will result in an error.vertexName
- the vertex name for which notifications are required.stateSet
- the set of states for which notifications are required. null implies allvoid vertexReconfigurationPlanned()
VertexManagerPlugin
wants to reconfigure the vertex, then it must
use this API to inform Tez about its intention. Without invoking this
method, it is invalid to re-configure the vertex, e.g. via the
setVertexParallelism(int, VertexLocationHint, Map, Map)
method if
the vertex is already fully defined. This can be invoked at any time until
VertexManagerPlugin.initialize()
has completed. Its invalid to
invoke this method after VertexManagerPlugin.initialize()
has
completeddoneReconfiguringVertex()
must be
invoked after the VertexManagerPlugin
is done reconfiguring the
vertex, . Actions like scheduling tasks or sending events do not count as
reconfiguration.void doneReconfiguringVertex()
vertexReconfigurationPlanned()
has been
invoked. This must be called after vertexReconfigurationPlanned()
is called.Copyright © 2015 Apache Software Foundation. All rights reserved.