public abstract class BaseFlowStep<Config> extends Object implements FlowStep<Config>, ProcessLogger, Serializable
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 FlowStepStats |
flowStepStats |
protected Map<Tap,Set<String>> |
sinks
Field sink
|
protected Map<Tap,Set<String>> |
sources
Field sources
|
protected Tap |
tempSink
Field tempSink
|
CASCADING_FLOW_STEP_ID
NULL
Modifier | Constructor and Description |
---|---|
protected |
BaseFlowStep(ElementGraph elementStepGraph,
FlowNodeGraph flowNodeGraph) |
protected |
BaseFlowStep(String name,
int ordinal) |
Modifier and Type | Method and Description |
---|---|
void |
addGroup(Group group) |
void |
addGroups(Collection<Group> groups) |
void |
addListener(FlowStepListener flowStepListener)
Method addListener registers the given
FlowStepListener with this instance. |
void |
addProcessAnnotation(Enum annotation) |
void |
addProcessAnnotation(String key,
String value) |
void |
addSink(String name,
Tap sink) |
void |
addSource(String name,
Tap source) |
void |
clean() |
abstract void |
clean(Config config) |
protected Throwable |
commitSinks() |
protected void |
configure() |
boolean |
containsPipeNamed(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(Object object) |
protected void |
fireOnCompleted() |
protected void |
fireOnRunning() |
protected void |
fireOnStarting() |
protected void |
fireOnStopping() |
protected void |
fireOnThrowable(Throwable throwable) |
Set<Tap> |
getAllAccumulatedSources() |
Collection<Operation> |
getAllOperations() |
protected EnumMultiMap |
getAnnotations() |
Config |
getConfig()
Method getConfig returns the current initialized configuration.
|
Map<Object,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() |
Flow<Config> |
getFlow() |
String |
getFlowID() |
String |
getFlowName()
Method getParentFlowName returns the parentFlowName of this FlowStep object.
|
FlowNodeGraph |
getFlowNodeGraph() |
FlowStepJob<Config> |
getFlowStepJob() |
FlowStepStats |
getFlowStepStats() |
Group |
getGroup() |
Collection<Group> |
getGroups() |
String |
getID()
Method getId returns the id of this FlowStep object.
|
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 String |
getNodeDisplayName(FlowNode flowNode,
int idLength) |
int |
getNumFlowNodes() |
int |
getOrdinal() |
Set<Scope> |
getPreviousScopes(FlowElement flowElement)
Method getPreviousScopes returns the previous Scope instances.
|
Map<String,String> |
getProcessAnnotations()
Method getProcessAnnotations returns an immutable Map of platform specific annotations or meta-data
that describe the current model type.
|
Tap |
getSink() |
Set<FlowElement> |
getSinkElements() |
Set<String> |
getSinkName(Tap sink) |
Set<Tap> |
getSinkTaps() |
Tap |
getSinkWith(String identifier) |
Set<FlowElement> |
getSourceElements() |
Set<String> |
getSourceName(Tap source) |
Set<Tap> |
getSourceTaps() |
Tap |
getSourceWith(String identifier) |
String |
getStepDisplayName()
Method getStepDisplayName returns the stepDisplayName of this FlowStep object.
|
protected String |
getStepDisplayName(int idLength) |
int |
getSubmitPriority()
Method getSubmitPriority returns the submitPriority of this FlowStep object.
|
Tap |
getTrap(String name) |
Map<String,Tap> |
getTrapMap() |
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(String message,
Object... arguments) |
void |
logError(String message,
Object... arguments) |
void |
logError(String message,
Throwable throwable) |
void |
logInfo(String message,
Object... arguments) |
void |
logWarn(String message) |
void |
logWarn(String message,
Object... arguments) |
void |
logWarn(String message,
Throwable throwable) |
protected Throwable |
prepareResources() |
boolean |
removeListener(FlowStepListener flowStepListener)
Method removeListener removes the given flowStepListener from this instance.
|
protected Throwable |
rollbackSinks() |
protected void |
setConfig(Config flowStepConf)
Set the initialized flowStepConf Config instance
|
void |
setFlow(Flow<Config> flow) |
protected void |
setFlowName(String flowName) |
void |
setFlowStepStats(FlowStepStats flowStepStats) |
void |
setName(String name) |
void |
setOrdinal(int ordinal) |
void |
setSubmitPriority(int submitPriority)
Method setSubmitPriority sets the submitPriority of this FlowStep object.
|
String |
toString() |
protected transient FlowStepStats flowStepStats
protected BaseFlowStep(String name, int ordinal)
protected BaseFlowStep(ElementGraph elementStepGraph, FlowNodeGraph flowNodeGraph)
protected void configure()
public 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 String getName()
FlowStep
getName
in interface FlowStep<Config>
getName
in interface ProcessModel
public Map<String,String> getProcessAnnotations()
ProcessModel
ProcessModel.addProcessAnnotation(Enum)
or ProcessModel.addProcessAnnotation(String, String)
to insert
annotations or meta-data.getProcessAnnotations
in interface ProcessModel
public void addProcessAnnotation(Enum annotation)
addProcessAnnotation
in interface ProcessModel
public void addProcessAnnotation(String key, String value)
addProcessAnnotation
in interface ProcessModel
public String getFlowName()
FlowStep
getFlowName
in interface FlowStep<Config>
protected void setFlowName(String flowName)
public Config getConfig()
FlowStep
public Map<Object,Object> getConfigAsProperties()
FlowStep
Map
of
key value pairs.getConfigAsProperties
in interface FlowStep<Config>
protected void setConfig(Config flowStepConf)
flowStepConf
- of type Configpublic String getStepDisplayName()
FlowStep
getStepDisplayName
in interface FlowStep<Config>
protected String getStepDisplayName(int idLength)
protected String getNodeDisplayName(FlowNode flowNode, int idLength)
public int getSubmitPriority()
FlowStep
getSubmitPriority
in interface FlowStep<Config>
getSubmitPriority
in interface ProcessModel
public void setSubmitPriority(int submitPriority)
FlowStep
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 Set<FlowElement> getSourceElements()
getSourceElements
in interface ProcessModel
public Set<FlowElement> getSinkElements()
getSinkElements
in interface ProcessModel
public Collection<Group> getGroups()
getGroups
in interface ProcessModel
public void addGroups(Collection<Group> groups)
public Set<Tap> getAllAccumulatedSources()
public Set<Tap> getSourceTaps()
getSourceTaps
in interface ProcessModel
public Set<Tap> getSinkTaps()
getSinkTaps
in interface ProcessModel
public Set<String> getSourceName(Tap source)
getSourceName
in interface FlowStep<Config>
public Set<String> getSinkName(Tap sink)
getSinkName
in interface FlowStep<Config>
public Tap getSourceWith(String identifier)
getSourceWith
in interface FlowStep<Config>
public Tap getSinkWith(String identifier)
getSinkWith
in interface FlowStep<Config>
public Map<String,Tap> getTrapMap()
getTrapMap
in interface ProcessModel
protected Throwable prepareResources()
protected Throwable commitSinks()
protected Throwable rollbackSinks()
public abstract Config createInitializedConfig(FlowProcess<Config> flowProcess, Config parentConfig)
flowProcess
- parentConfig
- public Set<Scope> getPreviousScopes(FlowElement flowElement)
flowElement
- of type FlowElementpublic Scope getNextScope(FlowElement flowElement)
flowElement
- of type FlowElementpublic FlowElement getNextFlowElement(Scope scope)
public Collection<Operation> getAllOperations()
public boolean containsPipeNamed(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(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)
public final boolean isInfoEnabled()
isInfoEnabled
in interface ProcessLogger
public final boolean isDebugEnabled()
isDebugEnabled
in interface ProcessLogger
public void logDebug(String message, Object... arguments)
logDebug
in interface ProcessLogger
public void logInfo(String message, Object... arguments)
logInfo
in interface ProcessLogger
public void logWarn(String message)
logWarn
in interface ProcessLogger
public void logWarn(String message, Throwable throwable)
logWarn
in interface ProcessLogger
public void logWarn(String message, Object... arguments)
logWarn
in interface ProcessLogger
public void logError(String message, Object... arguments)
logError
in interface ProcessLogger
public void logError(String message, Throwable throwable)
logError
in interface ProcessLogger
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.