public class FlowDef extends UnitOfWorkDef<FlowDef>
Flow
.
This allows for ad-hoc building of Flow data and meta-data, like tags.
Instead of calling one of the FlowConnector
connect methods, FlowConnector.connect(FlowDef)
can be called.Modifier and Type | Field and Description |
---|---|
protected java.util.List<AssemblyPlanner> |
assemblyPlanners |
protected AssertionLevel |
assertionLevel |
protected java.util.Map<java.lang.String,Tap> |
checkpoints |
protected java.util.List<java.lang.String> |
classPath |
protected DebugLevel |
debugLevel |
protected java.util.HashMap<java.lang.String,java.lang.String> |
flowDescriptor |
protected java.lang.String |
runID |
protected java.util.Map<java.lang.String,Tap> |
sinks |
protected java.util.Map<java.lang.String,Tap> |
sources |
protected java.util.List<Pipe> |
tails |
protected java.util.Map<java.lang.String,Tap> |
traps |
name, tags
Modifier | Constructor and Description |
---|---|
|
FlowDef()
Constructor FlowDef creates a new FlowDef instance.
|
protected |
FlowDef(FlowDef flowDef,
java.util.Map<java.lang.String,Tap> sources,
java.util.Map<java.lang.String,Tap> sinks,
java.util.Map<java.lang.String,Tap> traps,
java.util.Map<java.lang.String,Tap> checkpoints) |
Modifier and Type | Method and Description |
---|---|
FlowDef |
addAssemblyPlanner(AssemblyPlanner assemblyPlanner)
Method addAssemblyPlanner adds new AssemblyPlanner instances to be evaluated.
|
FlowDef |
addCheckpoint(Checkpoint pipe,
Tap checkpoint)
Method addCheckpoint adds a new checkpoint
Tap named after the given Checkpoint for use in the resulting Flow . |
FlowDef |
addCheckpoint(java.lang.String name,
Tap checkpoint)
|
FlowDef |
addCheckpoints(java.util.Map<java.lang.String,Tap> checkpoints)
Method addCheckpoints adds a Map of the names and
Tap pairs. |
FlowDef |
addDescription(java.lang.String description)
Method addDescription adds a user readable description to the flowDescriptor.
|
FlowDef |
addDescription(java.lang.String key,
java.lang.String value)
Method addDescription adds a description to the flowDescriptor.
|
FlowDef |
addDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)
Method addProperties adds all properties in the given map in order to the flowDescriptor.
|
FlowDef |
addSink(Pipe tail,
Tap sink)
|
FlowDef |
addSink(java.lang.String name,
Tap sink)
|
FlowDef |
addSinks(java.util.Map<java.lang.String,Tap> sinks)
Method addSinks adds a Map of the named and
Tap pairs. |
FlowDef |
addSource(Pipe pipe,
Tap source)
|
FlowDef |
addSource(java.lang.String name,
Tap source)
|
FlowDef |
addSources(java.util.Map<java.lang.String,Tap> sources)
Method addSources adds a map of name and
Tap pairs. |
FlowDef |
addTail(Pipe tail)
Method addTail adds a new
Pipe to this FlowDef that represents a tail in a pipe assembly. |
FlowDef |
addTails(java.util.Collection<Pipe> tails)
Method addTails adds a Collection of tails.
|
FlowDef |
addTails(Pipe... tails)
Method addTails adds an array of tails.
|
FlowDef |
addTailSink(Pipe tail,
Tap sink)
|
FlowDef |
addToClassPath(java.lang.String artifact)
Adds each given artifact to the classpath the assembly will execute under allowing
Operator s to dynamically load classes and resources from a ClassLoader . |
FlowDef |
addTrap(Pipe pipe,
Tap trap)
|
FlowDef |
addTrap(java.lang.String name,
Tap trap)
|
FlowDef |
addTraps(java.util.Map<java.lang.String,Tap> traps)
Method addTraps adds a Map of the names and
Tap pairs. |
static FlowDef |
flowDef()
Creates a new instance of a FlowDef.
|
java.util.List<AssemblyPlanner> |
getAssemblyPlanners()
Method getAssemblyPlanners returns the current registered AssemblyPlanners.
|
AssertionLevel |
getAssertionLevel() |
java.util.Map<java.lang.String,Tap> |
getCheckpoints()
Method getCheckpoints returns the checkpoint taps of this FlowDef object.
|
java.util.Map<java.lang.String,Tap> |
getCheckpointsCopy()
Method getCheckpointsCopy returns a copy of the checkpoint tap Map.
|
java.util.List<java.lang.String> |
getClassPath() |
DebugLevel |
getDebugLevel() |
java.util.HashMap<java.lang.String,java.lang.String> |
getFlowDescriptor()
Method getFlowDescriptor returns the flowDescriptor of this FlowDef.
|
java.lang.String |
getRunID() |
java.util.Map<java.lang.String,Tap> |
getSinks()
Method getSinks returns the sinks of this FlowDef object.
|
java.util.Map<java.lang.String,Tap> |
getSinksCopy()
Method getSinksCopy returns a copy of the sink Map.
|
java.util.Map<java.lang.String,Tap> |
getSources()
Method getSources returns the sources of this FlowDef object.
|
java.util.Map<java.lang.String,Tap> |
getSourcesCopy()
Method getSourcesCopy returns a copy of the sources Map.
|
java.util.List<Pipe> |
getTails()
Method getTails returns all the current pipe assembly tails the FlowDef holds.
|
Pipe[] |
getTailsArray()
Method getTailsArray returns all the current pipe assembly tails the FlowDef holds.
|
java.util.Map<java.lang.String,Tap> |
getTraps()
Method getTraps returns the traps of this FlowDef object.
|
java.util.Map<java.lang.String,Tap> |
getTrapsCopy()
Method getTrapsCopy returns a copy of the trap Map.
|
FlowDef |
setAssertionLevel(AssertionLevel assertionLevel) |
FlowDef |
setDebugLevel(DebugLevel debugLevel) |
FlowDef |
setRunID(java.lang.String runID)
Method setRunID sets the checkpoint run or execution ID to be used to find prior failed runs against
this runID.
|
protected java.util.Map<java.lang.String,Tap> checkpoints
protected java.util.List<java.lang.String> classPath
protected java.util.List<AssemblyPlanner> assemblyPlanners
protected java.util.HashMap<java.lang.String,java.lang.String> flowDescriptor
protected AssertionLevel assertionLevel
protected DebugLevel debugLevel
protected java.lang.String runID
public FlowDef()
public java.util.List<AssemblyPlanner> getAssemblyPlanners()
public FlowDef addAssemblyPlanner(AssemblyPlanner assemblyPlanner)
assemblyPlanner
- of type AssemblyPlannerpublic java.util.Map<java.lang.String,Tap> getSources()
public java.util.Map<java.lang.String,Tap> getSourcesCopy()
public java.util.HashMap<java.lang.String,java.lang.String> getFlowDescriptor()
public FlowDef addSource(java.lang.String name, Tap source)
name
- of Stringsource
- of Tappublic FlowDef addSource(Pipe pipe, Tap source)
Tap
named after the given Pipe
for use in the resulting Flow
.
If the given pipe is not a head pipe, it will be resolved. If more than one is found, an
IllegalArgumentException
will be thrown.pipe
- of Pipesource
- of Tappublic FlowDef addSources(java.util.Map<java.lang.String,Tap> sources)
Tap
pairs.sources
- of Mappublic FlowDef addDescription(java.lang.String description)
FlowDescriptors.DESCRIPTION
key.public FlowDef addDescription(java.lang.String key, java.lang.String value)
FlowDescriptors
.
If an existing key exists, it will be appended to the original value using
FlowDescriptors.VALUE_SEPARATOR
.key
- The key as a String.value
- The value as a String.public FlowDef addDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)
FlowDescriptors
.descriptions
- The properties to be added to the map.public java.util.Map<java.lang.String,Tap> getSinks()
public java.util.Map<java.lang.String,Tap> getSinksCopy()
public FlowDef addSink(java.lang.String name, Tap sink)
name
- of Stringsink
- of Tappublic FlowDef addSink(Pipe tail, Tap sink)
tail
- of Pipesink
- of Tappublic FlowDef addTailSink(Pipe tail, Tap sink)
Pipe
and sink Tap
to this FlowDef.
This is a convenience method for adding both a tail and sink simultaneously. There isn't a similar method
for heads and sources as the head Pipe can always be derived.tail
- of Pipesink
- of Tappublic FlowDef addSinks(java.util.Map<java.lang.String,Tap> sinks)
Tap
pairs.sinks
- of Mappublic java.util.Map<java.lang.String,Tap> getTraps()
public java.util.Map<java.lang.String,Tap> getTrapsCopy()
public FlowDef addTrap(java.lang.String name, Tap trap)
name
- of Stringtrap
- of Tappublic FlowDef addTrap(Pipe pipe, Tap trap)
pipe
- of Pipetrap
- of Tappublic FlowDef addTraps(java.util.Map<java.lang.String,Tap> traps)
Tap
pairs.traps
- of Mappublic java.util.Map<java.lang.String,Tap> getCheckpoints()
public java.util.Map<java.lang.String,Tap> getCheckpointsCopy()
public FlowDef addCheckpoint(java.lang.String name, Tap checkpoint)
name
- of Stringcheckpoint
- of Tappublic FlowDef addCheckpoint(Checkpoint pipe, Tap checkpoint)
Tap
named after the given Checkpoint
for use in the resulting Flow
.pipe
- of Pipecheckpoint
- of Tappublic FlowDef addCheckpoints(java.util.Map<java.lang.String,Tap> checkpoints)
Tap
pairs.checkpoints
- of Mappublic java.util.List<Pipe> getTails()
public Pipe[] getTailsArray()
public FlowDef addTail(Pipe tail)
Pipe
to this FlowDef that represents a tail in a pipe assembly.
Be sure to add a sink tap that has the same name as this tail.tail
- of Pipepublic FlowDef addTails(java.util.Collection<Pipe> tails)
tails
- of Collectionpublic FlowDef addTails(Pipe... tails)
tails
- of Pipe...public FlowDef setAssertionLevel(AssertionLevel assertionLevel)
public AssertionLevel getAssertionLevel()
public FlowDef setDebugLevel(DebugLevel debugLevel)
public DebugLevel getDebugLevel()
public FlowDef setRunID(java.lang.String runID)
Flow
fails to execute, a subsequent attempt to run the same Flow with the same
runID will allow the Flow instance to start where it left off.
Not all planners support this feature.
A Flow name is required when using a runID.runID
- of type Stringpublic java.lang.String getRunID()
public java.util.List<java.lang.String> getClassPath()
public FlowDef addToClassPath(java.lang.String artifact)
Operator
s to dynamically load classes and resources from a ClassLoader
.artifact
- a jar or other file String pathCopyright © 2007-2015 Xplenty, Inc. All Rights Reserved.