public abstract class BaseFlowStep<Config> extends java.lang.Object implements FlowStep<Config>, ProcessLogger, java.io.Serializable
FlowSteps are submitted in order of dependency. If two or more steps do not share the same dependencies and all
can be scheduled simultaneously, the getSubmitPriority()
value determines the order in which
all steps will be submitted for execution. The default submit priority is 5.
This class is for internal use, there are no stable public methods.
Modifier and Type | Field and Description |
---|---|
protected ElementGraph |
elementGraph
Field elementGraph
|
protected FlowNodeGraph |
flowNodeGraph
Field flowNodeGraph
|
protected FlowStepStats |
flowStepStats |
protected java.util.Map<Tap,java.util.Set<java.lang.String>> |
sinks
Field sink
|
protected java.util.Map<Tap,java.util.Set<java.lang.String>> |
sources
Field sources
|
protected Tap |
tempSink
Field tempSink
|
CASCADING_FLOW_STEP_ID
NULL
Modifier | Constructor and Description |
---|---|
protected |
BaseFlowStep() |
protected |
BaseFlowStep(ElementGraph elementStepGraph,
FlowNodeGraph flowNodeGraph) |
protected |
BaseFlowStep(ElementGraph elementStepGraph,
FlowNodeGraph flowNodeGraph,
java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor) |
protected |
BaseFlowStep(java.lang.String name,
int ordinal) |
protected |
BaseFlowStep(java.lang.String name,
int ordinal,
FlowNodeGraph flowNodeGraph,
java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor) |
protected |
BaseFlowStep(java.lang.String name,
int ordinal,
java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAllGroups() |
void |
addGroup(Group group) |
void |
addGroups(java.util.Collection<Group> groups) |
void |
addListener(FlowStepListener flowStepListener)
Method addListener registers the given
FlowStepListener with this instance. |
void |
addProcessAnnotation(java.lang.Enum annotation) |
void |
addProcessAnnotation(java.lang.String key,
java.lang.String value) |
void |
addSink(java.lang.String name,
Tap sink) |
protected static void |
addSinks(BaseFlowStep flowStep,
ElementGraph elementGraph,
java.util.Set<Tap> sinks) |
void |
addSource(java.lang.String name,
Tap source) |
protected static void |
addSources(BaseFlowStep flowStep,
ElementGraph elementGraph,
java.util.Set<Tap> sources) |
void |
clean() |
abstract void |
clean(Config config) |
protected java.lang.Throwable |
commitSinks() |
protected void |
configure() |
boolean |
containsPipeNamed(java.lang.String pipeName)
Returns true if this FlowStep contains a pipe/branch with the given name.
|
protected ClientState |
createClientState(FlowProcess flowProcess) |
protected abstract FlowStepJob |
createFlowStepJob(ClientState clientState,
FlowProcess<Config> flowProcess,
Config initializedStepConfig) |
abstract Config |
createInitializedConfig(FlowProcess<Config> flowProcess,
Config parentConfig)
Public for testing.
|
boolean |
equals(java.lang.Object object) |
protected java.util.Collection<SerializableType> |
findAllSerializableTypes() |
protected void |
fireOnCompleted() |
protected void |
fireOnRunning() |
protected void |
fireOnStarting() |
protected void |
fireOnStopping() |
protected void |
fireOnThrowable(java.lang.Throwable throwable) |
java.util.Set<Tap> |
getAllAccumulatedSources()
Returns all source Tap instances annotated by the planner as being
StreamMode.Accumulated . |
java.util.Collection<Operation> |
getAllOperations() |
java.util.Set<Tap> |
getAllStreamedSources()
Returns all source Tap instances annotated by the planner as being
StreamMode.Streamed . |
protected EnumMultiMap |
getAnnotations() |
Config |
getConfig()
Method getConfig returns the current initialized configuration.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getConfigAsProperties()
Method getConfigAsProperties converts the internal configuration object into a
Map of
key value pairs. |
FlowStepJob<Config> |
getCreateFlowStepJob(FlowProcess<Config> flowProcess,
Config parentConfig) |
ElementGraph |
getElementGraph() |
protected java.util.Set<java.lang.String> |
getFieldDeclaredSerializations(java.lang.Class base) |
Flow<Config> |
getFlow() |
java.lang.String |
getFlowID() |
java.lang.String |
getFlowName()
Method getParentFlowName returns the parentFlowName of this FlowStep object.
|
FlowNodeGraph |
getFlowNodeGraph() |
java.util.Map<java.lang.String,java.lang.String> |
getFlowStepDescriptor()
Returns an immutable map of properties giving more details about the FlowStep object.
|
FlowStepJob<Config> |
getFlowStepJob() |
FlowStepStats |
getFlowStepStats() |
Group |
getGroup() |
java.util.Collection<Group> |
getGroups() |
java.lang.String |
getID()
Method getId returns the id of this FlowStep object.
|
java.lang.String |
getName()
Method getName returns the name of this FlowStep object.
|
FlowElement |
getNextFlowElement(Scope scope) |
Scope |
getNextScope(FlowElement flowElement)
Method getNextScope returns the next Scope instance in the graph.
|
protected java.lang.String |
getNodeDisplayName(FlowNode flowNode,
int idLength) |
int |
getNumFlowNodes() |
int |
getOrdinal() |
java.util.Set<Scope> |
getPreviousScopes(FlowElement flowElement)
Method getPreviousScopes returns the previous Scope instances.
|
java.util.Map<java.lang.String,java.lang.String> |
getProcessAnnotations()
Method getProcessAnnotations returns an immutable Map of platform specific annotations or meta-data
that describe the current model type.
|
Tap |
getSink() |
java.util.Set<FlowElement> |
getSinkElements() |
java.util.Set<java.lang.String> |
getSinkName(Tap sink) |
java.util.Set<Tap> |
getSinkTaps() |
Tap |
getSinkWith(java.lang.String identifier) |
java.util.Set<FlowElement> |
getSourceElements() |
java.util.Set<java.lang.String> |
getSourceName(Tap source) |
java.util.Set<Tap> |
getSourceTaps() |
Tap |
getSourceWith(java.lang.String identifier) |
java.lang.String |
getStepDisplayName()
Method getStepDisplayName returns the stepDisplayName of this FlowStep object.
|
protected java.lang.String |
getStepDisplayName(int idLength) |
int |
getSubmitPriority()
Method getSubmitPriority returns the submitPriority of this FlowStep object.
|
Tap |
getTrap(java.lang.String name) |
java.util.Map<java.lang.String,Tap> |
getTrapMap() |
java.util.Set<Tap> |
getTraps() |
int |
hashCode() |
boolean |
hasListeners()
Method hasListeners returns true if
FlowStepListener instances have been registered. |
protected void |
initConfFromNodeConfigDef(ElementGraph nodeElementGraph,
ConfigDef.Setter setter) |
protected void |
initConfFromStepConfigDef(ConfigDef.Setter setter) |
boolean |
isDebugEnabled() |
boolean |
isInfoEnabled() |
void |
logDebug(java.lang.String message,
java.lang.Object... arguments) |
void |
logError(java.lang.String message,
java.lang.Object... arguments) |
void |
logError(java.lang.String message,
java.lang.Throwable throwable) |
void |
logInfo(java.lang.String message,
java.lang.Object... arguments) |
void |
logWarn(java.lang.String message) |
void |
logWarn(java.lang.String message,
java.lang.Object... arguments) |
void |
logWarn(java.lang.String message,
java.lang.Throwable throwable) |
protected java.lang.Throwable |
prepareResources() |
boolean |
removeListener(FlowStepListener flowStepListener)
Method removeListener removes the given flowStepListener from this instance.
|
protected java.lang.Throwable |
rollbackSinks() |
protected void |
setConfig(Config flowStepConf)
Set the initialized flowStepConf Config instance
|
void |
setFlow(Flow<Config> flow) |
protected void |
setFlowName(java.lang.String flowName) |
protected void |
setFlowStepDescriptor(java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor) |
void |
setFlowStepStats(FlowStepStats flowStepStats) |
void |
setName(java.lang.String name) |
void |
setOrdinal(int ordinal) |
void |
setSubmitPriority(int submitPriority)
Method setSubmitPriority sets the submitPriority of this FlowStep object.
|
java.lang.String |
toString() |
protected ElementGraph elementGraph
protected FlowNodeGraph flowNodeGraph
protected transient FlowStepStats flowStepStats
protected BaseFlowStep(java.lang.String name, int ordinal)
protected BaseFlowStep(java.lang.String name, int ordinal, java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor)
protected BaseFlowStep(java.lang.String name, int ordinal, FlowNodeGraph flowNodeGraph, java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor)
protected BaseFlowStep(ElementGraph elementStepGraph, FlowNodeGraph flowNodeGraph)
protected BaseFlowStep(ElementGraph elementStepGraph, FlowNodeGraph flowNodeGraph, java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor)
protected BaseFlowStep()
protected void configure()
protected void addAllGroups()
public java.lang.String getID()
FlowStep
getID
in interface FlowStep<Config>
getID
in interface ProcessModel
public void setOrdinal(int ordinal)
public int getOrdinal()
getOrdinal
in interface FlowStep<Config>
getOrdinal
in interface ProcessModel
public java.lang.String getName()
FlowStep
getName
in interface FlowStep<Config>
getName
in interface ProcessModel
public void setName(java.lang.String name)
public java.util.Map<java.lang.String,java.lang.String> getFlowStepDescriptor()
FlowStep
FlowStep descriptions provide meta-data to monitoring systems describing the workload a given FlowStep represents.
For known description types, see FlowStepDescriptors
.
getFlowStepDescriptor
in interface FlowStep<Config>
protected void setFlowStepDescriptor(java.util.Map<java.lang.String,java.lang.String> flowStepDescriptor)
public java.util.Map<java.lang.String,java.lang.String> getProcessAnnotations()
ProcessModel
Use ProcessModel.addProcessAnnotation(Enum)
or ProcessModel.addProcessAnnotation(String, String)
to insert
annotations or meta-data.
getProcessAnnotations
in interface ProcessModel
public void addProcessAnnotation(java.lang.Enum annotation)
addProcessAnnotation
in interface ProcessModel
public void addProcessAnnotation(java.lang.String key, java.lang.String value)
addProcessAnnotation
in interface ProcessModel
public java.lang.String getFlowName()
FlowStep
getFlowName
in interface FlowStep<Config>
protected void setFlowName(java.lang.String flowName)
public Config getConfig()
FlowStep
The returned configuration is mutable and may be changed prior to this step being started or submitted.
public java.util.Map<java.lang.Object,java.lang.Object> getConfigAsProperties()
FlowStep
Map
of
key value pairs.getConfigAsProperties
in interface FlowStep<Config>
protected void setConfig(Config flowStepConf)
flowStepConf
- of type Configpublic java.lang.String getStepDisplayName()
FlowStep
getStepDisplayName
in interface FlowStep<Config>
protected java.lang.String getStepDisplayName(int idLength)
protected java.lang.String getNodeDisplayName(FlowNode flowNode, int idLength)
public int getSubmitPriority()
FlowStep
10 is lowest, 1 is the highest, 5 is the default.
getSubmitPriority
in interface FlowStep<Config>
getSubmitPriority
in interface ProcessModel
public void setSubmitPriority(int submitPriority)
FlowStep
10 is lowest, 1 is the highest, 5 is the default.
setSubmitPriority
in interface FlowStep<Config>
submitPriority
- the submitPriority of this FlowStep object.public void setFlowStepStats(FlowStepStats flowStepStats)
setFlowStepStats
in interface FlowStep<Config>
public FlowStepStats getFlowStepStats()
getFlowStepStats
in interface FlowStep<Config>
public ElementGraph getElementGraph()
getElementGraph
in interface ProcessModel
protected EnumMultiMap getAnnotations()
public FlowNodeGraph getFlowNodeGraph()
getFlowNodeGraph
in interface FlowStep<Config>
public int getNumFlowNodes()
getNumFlowNodes
in interface FlowStep<Config>
public java.util.Set<FlowElement> getSourceElements()
getSourceElements
in interface ProcessModel
public java.util.Set<FlowElement> getSinkElements()
getSinkElements
in interface ProcessModel
public java.util.Collection<Group> getGroups()
getGroups
in interface ProcessModel
public java.util.Set<Tap> getAllAccumulatedSources()
StreamMode.Accumulated
.public java.util.Set<Tap> getAllStreamedSources()
StreamMode.Streamed
.public java.util.Set<Tap> getSourceTaps()
getSourceTaps
in interface ProcessModel
public java.util.Set<Tap> getSinkTaps()
getSinkTaps
in interface ProcessModel
public java.util.Set<java.lang.String> getSourceName(Tap source)
getSourceName
in interface FlowStep<Config>
public java.util.Set<java.lang.String> getSinkName(Tap sink)
getSinkName
in interface FlowStep<Config>
public Tap getSourceWith(java.lang.String identifier)
getSourceWith
in interface FlowStep<Config>
public Tap getSinkWith(java.lang.String identifier)
getSinkWith
in interface FlowStep<Config>
public java.util.Map<java.lang.String,Tap> getTrapMap()
getTrapMap
in interface ProcessModel
protected java.lang.Throwable prepareResources()
protected java.lang.Throwable commitSinks()
protected java.lang.Throwable rollbackSinks()
public abstract Config createInitializedConfig(FlowProcess<Config> flowProcess, Config parentConfig)
flowProcess
- parentConfig
- protected java.util.Set<java.lang.String> getFieldDeclaredSerializations(java.lang.Class base)
protected java.util.Collection<SerializableType> findAllSerializableTypes()
public java.util.Set<Scope> getPreviousScopes(FlowElement flowElement)
flowElement
- of type FlowElementpublic Scope getNextScope(FlowElement flowElement)
flowElement
- of type FlowElementpublic FlowElement getNextFlowElement(Scope scope)
public java.util.Collection<Operation> getAllOperations()
public boolean containsPipeNamed(java.lang.String pipeName)
FlowStep
containsPipeNamed
in interface FlowStep<Config>
pipeName
- the name of the Pipepublic void clean()
public boolean hasListeners()
FlowStep
FlowStepListener
instances have been registered.hasListeners
in interface FlowStep<Config>
public void addListener(FlowStepListener flowStepListener)
FlowStep
FlowStepListener
with this instance.addListener
in interface FlowStep<Config>
flowStepListener
- of type flowStepListenerpublic boolean removeListener(FlowStepListener flowStepListener)
FlowStep
removeListener
in interface FlowStep<Config>
flowStepListener
- of type FlowStepListenerprotected void fireOnCompleted()
protected void fireOnThrowable(java.lang.Throwable throwable)
protected void fireOnStopping()
protected void fireOnStarting()
protected void fireOnRunning()
protected ClientState createClientState(FlowProcess flowProcess)
public FlowStepJob<Config> getFlowStepJob()
public FlowStepJob<Config> getCreateFlowStepJob(FlowProcess<Config> flowProcess, Config parentConfig)
protected abstract FlowStepJob createFlowStepJob(ClientState clientState, FlowProcess<Config> flowProcess, Config initializedStepConfig)
protected void initConfFromNodeConfigDef(ElementGraph nodeElementGraph, ConfigDef.Setter setter)
protected void initConfFromStepConfigDef(ConfigDef.Setter setter)
protected static void addSources(BaseFlowStep flowStep, ElementGraph elementGraph, java.util.Set<Tap> sources)
protected static void addSinks(BaseFlowStep flowStep, ElementGraph elementGraph, java.util.Set<Tap> sinks)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final boolean isInfoEnabled()
isInfoEnabled
in interface ProcessLogger
public final boolean isDebugEnabled()
isDebugEnabled
in interface ProcessLogger
public void logDebug(java.lang.String message, java.lang.Object... arguments)
logDebug
in interface ProcessLogger
public void logInfo(java.lang.String message, java.lang.Object... arguments)
logInfo
in interface ProcessLogger
public void logWarn(java.lang.String message)
logWarn
in interface ProcessLogger
public void logWarn(java.lang.String message, java.lang.Throwable throwable)
logWarn
in interface ProcessLogger
public void logWarn(java.lang.String message, java.lang.Object... arguments)
logWarn
in interface ProcessLogger
public void logError(java.lang.String message, java.lang.Object... arguments)
logError
in interface ProcessLogger
public void logError(java.lang.String message, java.lang.Throwable throwable)
logError
in interface ProcessLogger
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.