@InterfaceAudience.Public @InterfaceStability.Unstable public abstract class EdgeManagerPluginOnDemand extends EdgeManagerPlugin
Constructor and Description |
---|
EdgeManagerPluginOnDemand(EdgeManagerPluginContext context)
Create an instance of the
EdgeManagerPluginOnDemand . |
Modifier and Type | Method and Description |
---|---|
EdgeManagerPluginContext |
getContext()
Return the
EdgeManagerPluginContext for this specific instance of
the vertex manager. |
abstract int |
getNumDestinationConsumerTasks(int sourceTaskIndex)
Get the number of destination tasks that consume data from the source task
|
abstract int |
getNumDestinationTaskPhysicalInputs(int destinationTaskIndex)
Get the number of physical inputs on the destination task
|
abstract int |
getNumSourceTaskPhysicalOutputs(int sourceTaskIndex)
Get the number of physical outputs on the source task
|
abstract void |
initialize()
Initializes the EdgeManagerPlugin.
|
abstract void |
prepareForRouting()
This method will be invoked just before routing of events will begin.
|
abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata |
routeCompositeDataMovementEventToDestination(int sourceTaskIndex,
int destinationTaskIndex)
The method provides the
EdgeManagerPluginOnDemand.EventRouteMetadata to route a
CompositeDataMovementEvent produced by the given source task to the
given destination task. |
void |
routeDataMovementEventToDestination(DataMovementEvent event,
int sourceTaskIndex,
int sourceOutputIndex,
Map<Integer,List<Integer>> destinationTaskAndInputIndices)
Return the routing information to inform consumers about the source task
output that is now available.
|
abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata |
routeDataMovementEventToDestination(int sourceTaskIndex,
int sourceOutputIndex,
int destinationTaskIndex)
The method provides the
EdgeManagerPluginOnDemand.EventRouteMetadata to route a
DataMovementEvent produced by the given source task to the given
destination task. |
int |
routeInputErrorEventToSource(InputReadErrorEvent event,
int destinationTaskIndex,
int destinationFailedInputIndex)
Return the source task index to which to send the input error event
|
abstract int |
routeInputErrorEventToSource(int destinationTaskIndex,
int destinationFailedInputIndex)
Return the source task index to which to send the input error event
|
abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata |
routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex,
int destinationTaskIndex)
The method provides the
EdgeManagerPluginOnDemand.EventRouteMetadata to route an
InputFailedEvent produced by the given source task to the given
destination task. |
void |
routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex,
Map<Integer,List<Integer>> destinationTaskAndInputIndices)
Return the routing information to inform consumers about the failure of a
source task whose outputs have been potentially lost.
|
public EdgeManagerPluginOnDemand(EdgeManagerPluginContext context)
EdgeManagerPluginOnDemand
. Classes
extending this to create a EdgeManagerPluginOnDemand
, must provide
the same constructor so that Tez can create an instance of the class at
runtime.context
- the context within which this EdgeManagerPluginOnDemand
will run. Includes information like configuration which the user
may have specified while setting up the edge.public abstract void initialize() throws Exception
EdgeManagerPluginContext
when the
EdgeManagerPlugin is replaced.initialize
in class EdgeManagerPlugin
Exception
public abstract void prepareForRouting() throws Exception
Exception
public abstract int getNumDestinationTaskPhysicalInputs(int destinationTaskIndex) throws Exception
getNumDestinationTaskPhysicalInputs
in class EdgeManagerPlugin
destinationTaskIndex
- Index of destination task for which number of
inputs is neededException
public abstract int getNumSourceTaskPhysicalOutputs(int sourceTaskIndex) throws Exception
getNumSourceTaskPhysicalOutputs
in class EdgeManagerPlugin
sourceTaskIndex
- Index of the source task for which number of outputs
is neededException
public abstract int getNumDestinationConsumerTasks(int sourceTaskIndex) throws Exception
getNumDestinationConsumerTasks
in class EdgeManagerPlugin
sourceTaskIndex
- Source task indexException
public abstract int routeInputErrorEventToSource(int destinationTaskIndex, int destinationFailedInputIndex) throws Exception
destinationTaskIndex
- Destination task that reported the errordestinationFailedInputIndex
- Index of the physical input on the destination task that reported
the errorException
@Nullable public abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata routeDataMovementEventToDestination(int sourceTaskIndex, int sourceOutputIndex, int destinationTaskIndex) throws Exception
EdgeManagerPluginOnDemand.EventRouteMetadata
to route a
DataMovementEvent
produced by the given source task to the given
destination task. The returned EdgeManagerPluginOnDemand.EventRouteMetadata
should have the
target input indices set to enable the routing. If the routing metadata is
common across different events then the plugin can cache and reuse the same
object.sourceTaskIndex
- The index of the task in the source vertex of this edge that
produced a DataMovementEvent
sourceOutputIndex
- Index of the physical output on the source task that produced the
eventdestinationTaskIndex
- EdgeManagerPluginOnDemand.EventRouteMetadata
with target indices set. Maybe null if
the given destination task does not read input from the given
source task.Exception
@Nullable public abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata routeCompositeDataMovementEventToDestination(int sourceTaskIndex, int destinationTaskIndex) throws Exception
EdgeManagerPluginOnDemand.EventRouteMetadata
to route a
CompositeDataMovementEvent
produced by the given source task to the
given destination task. The returned EdgeManagerPluginOnDemand.EventRouteMetadata
should have
the target input indices and source output indices set to enable the
routing. If the routing metadata is common across different events then the
plugin can cache and reuse the same object.sourceTaskIndex
- The index of the task in the source vertex of this edge that
produced a CompositeDataMovementEvent
destinationTaskIndex
- The index of the task in the destination vertex of this edgeEdgeManagerPluginOnDemand.EventRouteMetadata
with source and target indices set. This
may be null if the destination task does not read data from the
source task.Exception
@Nullable public abstract org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex, int destinationTaskIndex) throws Exception
EdgeManagerPluginOnDemand.EventRouteMetadata
to route an
InputFailedEvent
produced by the given source task to the given
destination task. The returned EdgeManagerPluginOnDemand.EventRouteMetadata
should have the
target input indices set to enable the routing. If the routing metadata is
common across different events then the plugin can cache and reuse the same
object.sourceTaskIndex
- The index of the failed task in the source vertex of this edge.destinationTaskIndex
- The index of a task in the destination vertex of this edge.EdgeManagerPluginOnDemand.EventRouteMetadata
with target indices set. Maybe null if
the given destination task does not read input from the given
source task.Exception
public EdgeManagerPluginContext getContext()
EdgeManagerPluginContext
for this specific instance of
the vertex manager.getContext
in class EdgeManagerPlugin
EdgeManagerPluginContext
for the inputpublic void routeDataMovementEventToDestination(DataMovementEvent event, int sourceTaskIndex, int sourceOutputIndex, Map<Integer,List<Integer>> destinationTaskAndInputIndices) throws Exception
routeDataMovementEventToDestination
in class EdgeManagerPlugin
event
- Data movement event that contains the output informationsourceTaskIndex
- Source task that produced the eventsourceOutputIndex
- Index of the physical output on the source task that produced the
eventdestinationTaskAndInputIndices
- Map via which the routing information is returnedException
public void routeInputSourceTaskFailedEventToDestination(int sourceTaskIndex, Map<Integer,List<Integer>> destinationTaskAndInputIndices) throws Exception
routeInputSourceTaskFailedEventToDestination
in class EdgeManagerPlugin
sourceTaskIndex
- Source taskdestinationTaskAndInputIndices
- Map via which the routing information is returnedException
public int routeInputErrorEventToSource(InputReadErrorEvent event, int destinationTaskIndex, int destinationFailedInputIndex) throws Exception
routeInputErrorEventToSource
in class EdgeManagerPlugin
event
- Input read error event. Has more information about the errordestinationTaskIndex
- Destination task that reported the errordestinationFailedInputIndex
- Index of the physical input on the destination task that reported
the errorException
Copyright © 2024 Apache Software Foundation. All rights reserved.