@InterfaceStability.Unstable @InterfaceAudience.Public public abstract class VertexManagerPlugin extends Object
Constructor and Description |
---|
VertexManagerPlugin(VertexManagerPluginContext context)
Crete an instance of the VertexManagerPlugin.
|
Modifier and Type | Method and Description |
---|---|
VertexManagerPluginContext |
getContext()
Return ahe
VertexManagerPluginContext for this specific instance of
the vertex manager. |
abstract void |
initialize()
Initialize the plugin.
|
abstract void |
onRootVertexInitialized(String inputName,
InputDescriptor inputDescriptor,
List<Event> events)
Notification that the inputs of this vertex have initialized
|
abstract void |
onSourceTaskCompleted(String srcVertexName,
Integer taskId)
Notification of a source vertex completion.
|
abstract void |
onVertexManagerEventReceived(VertexManagerEvent vmEvent)
Notification of an event directly sent to this vertex manager
|
abstract void |
onVertexStarted(Map<String,List<Integer>> completions)
Notification that the vertex is ready to start running tasks
|
void |
onVertexStateUpdated(VertexStateUpdate stateUpdate)
Receive notifications on vertex state changes.
|
public VertexManagerPlugin(VertexManagerPluginContext context)
context
- vertex manager plugin context which can be used to access the
payload, vertex properties, etcpublic abstract void initialize() throws Exception
Exception
public abstract void onVertexStarted(Map<String,List<Integer>> completions) throws Exception
completions
- Source vertices and all their tasks that have already completedException
public abstract void onSourceTaskCompleted(String srcVertexName, Integer taskId) throws Exception
srcVertexName
- taskId
- Index of the task that completedException
public abstract void onVertexManagerEventReceived(VertexManagerEvent vmEvent) throws Exception
vmEvent
- Exception
public abstract void onRootVertexInitialized(String inputName, InputDescriptor inputDescriptor, List<Event> events) throws Exception
inputName
- inputDescriptor
- events
- Exception
public final VertexManagerPluginContext getContext()
VertexManagerPluginContext
for this specific instance of
the vertex manager.VertexManagerPluginContext
for the inputpublic void onVertexStateUpdated(VertexStateUpdate stateUpdate) throws Exception
VertexManagerPluginContext.registerForVertexStateUpdates(String, java.util.Set)
. Notifications will be received for all registered state changes, and not
just for the latest state update. They will be in order in which the state
change occurred.
onVertexStarted(Map)
etc. and
multi-threading/concurrency implications must be considered.stateUpdate
- an event indicating the name of the vertex, and it's updated
state. Additional information may be available for specific
events, Look at the type hierarchy for
VertexStateUpdate
Exception
Copyright © 2015 Apache Software Foundation. All rights reserved.