cascading.flow
Class FlowDef

java.lang.Object
  extended by cascading.property.UnitOfWorkDef<FlowDef>
      extended by cascading.flow.FlowDef

public class FlowDef
extends UnitOfWorkDef<FlowDef>

Class FlowDef is a fluent interface for defining a 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.


Field Summary
protected  AssertionLevel assertionLevel
           
protected  Map<String,Tap> checkpoints
           
protected  DebugLevel debugLevel
           
protected  String runID
           
protected  Map<String,Tap> sinks
           
protected  Map<String,Tap> sources
           
protected  List<Pipe> tails
           
protected  Map<String,Tap> traps
           
 
Fields inherited from class cascading.property.UnitOfWorkDef
name, tags
 
Constructor Summary
FlowDef()
          Constructor FlowDef creates a new FlowDef instance.
 
Method Summary
 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(String name, Tap checkpoint)
          Method addCheckpoint adds a new named checkpoint Tap for use in the resulting Flow.
 FlowDef addCheckpoints(Map<String,Tap> checkpoints)
          Method addCheckpoints adds a Map of the names and Tap pairs.
 FlowDef addSink(Pipe tail, Tap sink)
          Method addSink adds a new sink Tap named after the given Pipe for use in the resulting Flow.
 FlowDef addSink(String name, Tap sink)
          Method addSink adds a new named sink Tap for use in the resulting Flow.
 FlowDef addSinks(Map<String,Tap> sinks)
          Method addSinks adds a Map of the named and Tap pairs.
 FlowDef addSource(Pipe pipe, Tap source)
          Method addSource adds a new source Tap named after the given Pipe for use in the resulting Flow.
 FlowDef addSource(String name, Tap source)
          Method addSource adds a new named source Tap for use in the resulting Flow.
 FlowDef addSources(Map<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(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)
          Method addTailSink adds the tail Pipe and sink Tap to this FlowDef.
 FlowDef addTrap(Pipe pipe, Tap trap)
          Method addTrap adds a new trap Tap named after the given Pipe for use in the resulting Flow.
 FlowDef addTrap(String name, Tap trap)
          Method addTrap adds a new named trap Tap for use in the resulting Flow.
 FlowDef addTraps(Map<String,Tap> traps)
          Method addTraps adds a Map of the names and Tap pairs.
static FlowDef flowDef()
          Creates a new instance of a FlowDef.
 AssertionLevel getAssertionLevel()
           
 Map<String,Tap> getCheckpoints()
          Method getCheckpoints returns the checkpoint taps of this FlowDef object.
 Map<String,Tap> getCheckpointsCopy()
          Method getCheckpointsCopy returns a copy of the checkpoint tap Map.
 DebugLevel getDebugLevel()
           
 String getRunID()
           
 Map<String,Tap> getSinks()
          Method getSinks returns the sinks of this FlowDef object.
 Map<String,Tap> getSinksCopy()
          Method getSinksCopy returns a copy of the sink Map.
 Map<String,Tap> getSources()
          Method getSources returns the sources of this FlowDef object.
 Map<String,Tap> getSourcesCopy()
          Method getSourcesCopy returns a copy of the sources Map.
 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.
 Map<String,Tap> getTraps()
          Method getTraps returns the traps of this FlowDef object.
 Map<String,Tap> getTrapsCopy()
          Method getTrapsCopy returns a copy of the trap Map.
 FlowDef setAssertionLevel(AssertionLevel assertionLevel)
           
 FlowDef setDebugLevel(DebugLevel debugLevel)
           
 FlowDef setRunID(String runID)
          Method setRunID sets the checkpoint run or execution ID to be used to find prior failed runs against this runID.
 
Methods inherited from class cascading.property.UnitOfWorkDef
addTag, addTags, getName, getTags, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sources

protected Map<String,Tap> sources

sinks

protected Map<String,Tap> sinks

traps

protected Map<String,Tap> traps

checkpoints

protected Map<String,Tap> checkpoints

tails

protected List<Pipe> tails

assertionLevel

protected AssertionLevel assertionLevel

debugLevel

protected DebugLevel debugLevel

runID

protected String runID
Constructor Detail

FlowDef

public FlowDef()
Constructor FlowDef creates a new FlowDef instance.

Method Detail

flowDef

public static FlowDef flowDef()
Creates a new instance of a FlowDef.

Returns:
a FlowDef

getSources

public Map<String,Tap> getSources()
Method getSources returns the sources of this FlowDef object.

Returns:
the sources (type Map) of this FlowDef object.

getSourcesCopy

public Map<String,Tap> getSourcesCopy()
Method getSourcesCopy returns a copy of the sources Map.

Returns:
the sourcesCopy (type Map) of this FlowDef object.

addSource

public FlowDef addSource(String name,
                         Tap source)
Method addSource adds a new named source Tap for use in the resulting Flow.

Parameters:
name - of String
source - of Tap
Returns:
FlowDef

addSource

public FlowDef addSource(Pipe pipe,
                         Tap source)
Method addSource adds a new 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.

Parameters:
pipe - of Pipe
source - of Tap
Returns:
FlowDef

addSources

public FlowDef addSources(Map<String,Tap> sources)
Method addSources adds a map of name and Tap pairs.

Parameters:
sources - of Map
Returns:
FlowDef

getSinks

public Map<String,Tap> getSinks()
Method getSinks returns the sinks of this FlowDef object.

Returns:
the sinks (type Map) of this FlowDef object.

getSinksCopy

public Map<String,Tap> getSinksCopy()
Method getSinksCopy returns a copy of the sink Map.

Returns:
the sinksCopy (type Map) of this FlowDef object.

addSink

public FlowDef addSink(String name,
                       Tap sink)
Method addSink adds a new named sink Tap for use in the resulting Flow.

Parameters:
name - of String
sink - of Tap
Returns:
FlowDef

addSink

public FlowDef addSink(Pipe tail,
                       Tap sink)
Method addSink adds a new sink Tap named after the given Pipe for use in the resulting Flow.

Parameters:
tail - of Pipe
sink - of Tap
Returns:
FlowDef

addTailSink

public FlowDef addTailSink(Pipe tail,
                           Tap sink)
Method addTailSink adds the tail 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.

Parameters:
tail - of Pipe
sink - of Tap
Returns:
FlowDef

addSinks

public FlowDef addSinks(Map<String,Tap> sinks)
Method addSinks adds a Map of the named and Tap pairs.

Parameters:
sinks - of Map
Returns:
FlowDef

getTraps

public Map<String,Tap> getTraps()
Method getTraps returns the traps of this FlowDef object.

Returns:
the traps (type Map) of this FlowDef object.

getTrapsCopy

public Map<String,Tap> getTrapsCopy()
Method getTrapsCopy returns a copy of the trap Map.

Returns:
the trapsCopy (type Map) of this FlowDef object.

addTrap

public FlowDef addTrap(String name,
                       Tap trap)
Method addTrap adds a new named trap Tap for use in the resulting Flow.

Parameters:
name - of String
trap - of Tap
Returns:
FlowDef

addTrap

public FlowDef addTrap(Pipe pipe,
                       Tap trap)
Method addTrap adds a new trap Tap named after the given Pipe for use in the resulting Flow.

Parameters:
pipe - of Pipe
trap - of Tap
Returns:
FlowDef

addTraps

public FlowDef addTraps(Map<String,Tap> traps)
Method addTraps adds a Map of the names and Tap pairs.

Parameters:
traps - of Map
Returns:
FlowDef

getCheckpoints

public Map<String,Tap> getCheckpoints()
Method getCheckpoints returns the checkpoint taps of this FlowDef object.

Returns:
the checkpoints (type Map) of this FlowDef object.

getCheckpointsCopy

public Map<String,Tap> getCheckpointsCopy()
Method getCheckpointsCopy returns a copy of the checkpoint tap Map.

Returns:
the checkpointsCopy (type Map) of this FlowDef object.

addCheckpoint

public FlowDef addCheckpoint(String name,
                             Tap checkpoint)
Method addCheckpoint adds a new named checkpoint Tap for use in the resulting Flow.

Parameters:
name - of String
checkpoint - of Tap
Returns:
FlowDef

addCheckpoint

public FlowDef addCheckpoint(Checkpoint pipe,
                             Tap checkpoint)
Method addCheckpoint adds a new checkpoint Tap named after the given Checkpoint for use in the resulting Flow.

Parameters:
pipe - of Pipe
checkpoint - of Tap
Returns:
FlowDef

addCheckpoints

public FlowDef addCheckpoints(Map<String,Tap> checkpoints)
Method addCheckpoints adds a Map of the names and Tap pairs.

Parameters:
checkpoints - of Map
Returns:
FlowDef

getTails

public List<Pipe> getTails()
Method getTails returns all the current pipe assembly tails the FlowDef holds.

Returns:
the tails (type List) of this FlowDef object.

getTailsArray

public Pipe[] getTailsArray()
Method getTailsArray returns all the current pipe assembly tails the FlowDef holds.

Returns:
the tailsArray (type Pipe[]) of this FlowDef object.

addTail

public FlowDef addTail(Pipe tail)
Method addTail adds a new 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.

Parameters:
tail - of Pipe
Returns:
FlowDef

addTails

public FlowDef addTails(Collection<Pipe> tails)
Method addTails adds a Collection of tails.

Parameters:
tails - of Collection
Returns:
FlowDef

addTails

public FlowDef addTails(Pipe... tails)
Method addTails adds an array of tails.

Parameters:
tails - of Pipe...
Returns:
FlowDef

setAssertionLevel

public FlowDef setAssertionLevel(AssertionLevel assertionLevel)

getAssertionLevel

public AssertionLevel getAssertionLevel()

setDebugLevel

public FlowDef setDebugLevel(DebugLevel debugLevel)

getDebugLevel

public DebugLevel getDebugLevel()

setRunID

public FlowDef setRunID(String runID)
Method setRunID sets the checkpoint run or execution ID to be used to find prior failed runs against this runID.

When given, and a 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.

Parameters:
runID -
Returns:

getRunID

public String getRunID()


Copyright © 2007-2012 Concurrent, Inc. All Rights Reserved.