cascading.cascade

## Class BaseCascade

- java.lang.Object
- - cascading.cascade.BaseCascade

- All Implemented Interfaces:
    Cascade, UnitOfWork<CascadeStats>, ProcessLogger

      public class BaseCascade
      extends Object
      implements ProcessLogger, Cascade

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `BaseCascade.CascadeJob` Class CascadeJob manages Flow execution in the current Cascade instance.

  - ### Field Summary

    - ### Fields inherited from interface cascading.util.ProcessLogger

      `NULL`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseCascade()` for testing

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(CascadeListener cascadeListener)`
    `void` | `cleanup()`
    `void` | `complete()` Method complete begins the current Cascade process if method `Cascade.start()` was not previously called.
    `List<Flow>` | `findFlows(String regex)` Method findFlows returns a List of flows whose names match the given regex pattern.
    `Collection<Flow>` | `findFlowsSinkingTo(String identifier)` Method findFlowsSinkingTo returns all Flow instances that writes to a sink with the given identifier.
    `Collection<Flow>` | `findFlowsSourcingFrom(String identifier)` Method findFlowsSourcingFrom returns all Flow instances that reads from a source with the given identifier.
    `protected void` | `fireOnStarting()`
    `protected void` | `fireOnStopping()`
    `Collection<Tap>` | `getAllTaps()` Method getAllTaps returns all source, sink, and checkpoint Tap instances associated with the managed Flow instances in this Cascade instance.
    `CascadeStats` | `getCascadeStats()` Method getCascadeStats returns the cascadeStats of this Cascade object.
    `Collection<Tap>` | `getCheckpointsTaps()` Method getCheckpointTaps returns all checkpoint Tap instances from all the Flow instances in this Cascade instance.
    `protected FlowGraph` | `getFlowGraph()`
    `List<Flow>` | `getFlows()` Method getFlows returns the flows managed by this Cascade object.
    `FlowSkipStrategy` | `getFlowSkipStrategy()` Method getFlowSkipStrategy returns the current `FlowSkipStrategy` used by this Flow.
    `Collection<Flow>` | `getHeadFlows()` Method getHeadFlows returns all Flow instances that are at the "head" of the flow graph.
    `String` | `getID()` Method getID returns the ID of this Cascade object.
    `protected IdentifierGraph` | `getIdentifierGraph()`
    `Collection<Flow>` | `getIntermediateFlows()` Method getIntermediateFlows returns all Flow instances that are neither at the "tail" or "tail" of the flow graph.
    `Collection<Tap>` | `getIntermediateTaps()` Method getIntermediateTaps returns all Tap instances that are neither at the source or sink of the flow graph.
    `String` | `getName()` Method getName returns the name of this Cascade object.
    `Collection<Flow>` | `getPredecessorFlows(Flow flow)` Method getPredecessorFlows returns a Collection of all the Flow instances that will be executed before the given Flow instance.
    `Collection<Tap>` | `getSinkTaps()` Method getSinkTaps returns all sink Tap instances in this Cascade instance.
    `Collection<Tap>` | `getSourceTaps()` Method getSourceTaps returns all source Tap instances in this Cascade instance.
    `UnitOfWorkSpawnStrategy` | `getSpawnStrategy()`
    `CascadeStats` | `getStats()`
    `Collection<Flow>` | `getSuccessorFlows(Flow flow)` Method getSuccessorFlows returns a Collection of all the Flow instances that will be executed after the given Flow instance.
    `String` | `getTags()` Method getTags returns the tags associated with this Cascade object.
    `Collection<Flow>` | `getTailFlows()` Method getTailFlows returns all Flow instances that are at the "tail" of the flow graph.
    `protected TapGraph` | `getTapGraph()`
    `boolean` | `hasListeners()`
    `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)`
    `void` | `prepare()`
    `protected void` | `printElementGraph(String filename, org.jgrapht.graph.SimpleDirectedGraph<String,BaseFlow.FlowHolder> graph)`
    `boolean` | `removeListener(CascadeListener flowListener)`
    `FlowSkipStrategy` | `setFlowSkipStrategy(FlowSkipStrategy flowSkipStrategy)` Method setFlowSkipStrategy sets a new `FlowSkipStrategy`, the current strategy, if any, is returned.
    `void` | `setSpawnStrategy(UnitOfWorkSpawnStrategy spawnStrategy)`
    `void` | `start()` Method start begins the current Cascade process.
    `void` | `stop()`
    `String` | `toString()`
    `void` | `writeDOT(String filename)` Method writeDOT writes this element graph to a DOT file for easy visualization and debugging.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BaseCascade

          protected BaseCascade()

      for testing

  - ### Method Detail

    - #### getName

          public String getName()

      Method getName returns the name of this Cascade object.
      Specified by:
        `getName` in interface `UnitOfWork<CascadeStats>`
      Returns:
        the name (type String) of this Cascade object.

    - #### getID

          public String getID()

      Method getID returns the ID of this Cascade object.

      The ID value is a long HEX String used to identify this instance globally. Subsequent Cascade instances created with identical parameters will not return the same ID.
      Specified by:
        `getID` in interface `UnitOfWork<CascadeStats>`
      Returns:
        the ID (type String) of this Cascade object.

    - #### getTags

          public String getTags()

      Method getTags returns the tags associated with this Cascade object.
      Specified by:
        `getTags` in interface `UnitOfWork<CascadeStats>`
      Returns:
        the tags (type String) of this Cascade object.

    - #### hasListeners

          public boolean hasListeners()

      Specified by:
        `hasListeners` in interface `Cascade`

    - #### addListener

          public void addListener(CascadeListener cascadeListener)

      Specified by:
        `addListener` in interface `Cascade`

    - #### removeListener

          public boolean removeListener(CascadeListener flowListener)

      Specified by:
        `removeListener` in interface `Cascade`

    - #### fireOnStopping

          protected void fireOnStopping()

    - #### fireOnStarting

          protected void fireOnStarting()

    - #### getCascadeStats

          public CascadeStats getCascadeStats()

      Description copied from interface: `Cascade`
      Method getCascadeStats returns the cascadeStats of this Cascade object.
      Specified by:
        `getCascadeStats` in interface `Cascade`
      Returns:
        the cascadeStats (type CascadeStats) of this Cascade object.

    - #### getStats

          public CascadeStats getStats()

      Specified by:
        `getStats` in interface `UnitOfWork<CascadeStats>`

    - #### getFlowGraph

          protected FlowGraph getFlowGraph()

    - #### getIdentifierGraph

          protected IdentifierGraph getIdentifierGraph()

    - #### getFlows

          public List<Flow> getFlows()

      Description copied from interface: `Cascade`
      Method getFlows returns the flows managed by this Cascade object. The returned `Flow` instances will be in topological order.
      Specified by:
        `getFlows` in interface `Cascade`
      Returns:
        the flows (type Collection) of this Cascade object.

    - #### findFlows

          public List<Flow> findFlows(String regex)

      Description copied from interface: `Cascade`
      Method findFlows returns a List of flows whose names match the given regex pattern.
      Specified by:
        `findFlows` in interface `Cascade`
      Parameters:
        `regex` - of type String
      Returns:
        List

    - #### getHeadFlows

          public Collection<Flow> getHeadFlows()

      Description copied from interface: `Cascade`
      Method getHeadFlows returns all Flow instances that are at the "head" of the flow graph.

      That is, they are the first to execute and have no Tap source dependencies with Flow instances in the this Cascade instance.
      Specified by:
        `getHeadFlows` in interface `Cascade`
      Returns:
        Collection

    - #### getTailFlows

          public Collection<Flow> getTailFlows()

      Description copied from interface: `Cascade`
      Method getTailFlows returns all Flow instances that are at the "tail" of the flow graph.

      That is, they are the last to execute and have no Tap sink dependencies with Flow instances in the this Cascade instance.
      Specified by:
        `getTailFlows` in interface `Cascade`
      Returns:
        Collection

    - #### getIntermediateFlows

          public Collection<Flow> getIntermediateFlows()

      Description copied from interface: `Cascade`
      Method getIntermediateFlows returns all Flow instances that are neither at the "tail" or "tail" of the flow graph.
      Specified by:
        `getIntermediateFlows` in interface `Cascade`
      Returns:
        Collection

    - #### getTapGraph

          protected TapGraph getTapGraph()

    - #### getSourceTaps

          public Collection<Tap> getSourceTaps()

      Description copied from interface: `Cascade`
      Method getSourceTaps returns all source Tap instances in this Cascade instance.

      That is, none of returned Tap instances are the sinks of other Flow instances in this Cascade.

      All `CompositeTap` instances are unwound if addressed directly by a managed Flow instance.
      Specified by:
        `getSourceTaps` in interface `Cascade`
      Returns:
        Collection

    - #### getSinkTaps

          public Collection<Tap> getSinkTaps()

      Description copied from interface: `Cascade`
      Method getSinkTaps returns all sink Tap instances in this Cascade instance.

      That is, none of returned Tap instances are the sources of other Flow instances in this Cascade.

      All `CompositeTap` instances are unwound if addressed directly by a managed Flow instance.

      This method will return checkpoint Taps managed by Flow instances if not used as a source by other Flow instances.
      Specified by:
        `getSinkTaps` in interface `Cascade`
      Returns:
        Collection

    - #### getCheckpointsTaps

          public Collection<Tap> getCheckpointsTaps()

      Description copied from interface: `Cascade`
      Method getCheckpointTaps returns all checkpoint Tap instances from all the Flow instances in this Cascade instance.
      Specified by:
        `getCheckpointsTaps` in interface `Cascade`
      Returns:
        Collection

    - #### getIntermediateTaps

          public Collection<Tap> getIntermediateTaps()

      Description copied from interface: `Cascade`
      Method getIntermediateTaps returns all Tap instances that are neither at the source or sink of the flow graph.

      This method does consider checkpoint Taps managed by Flow instances in this Cascade instance.
      Specified by:
        `getIntermediateTaps` in interface `Cascade`
      Returns:
        Collection

    - #### getAllTaps

          public Collection<Tap> getAllTaps()

      Description copied from interface: `Cascade`
      Method getAllTaps returns all source, sink, and checkpoint Tap instances associated with the managed Flow instances in this Cascade instance.
      Specified by:
        `getAllTaps` in interface `Cascade`
      Returns:
        Collection

    - #### getSuccessorFlows

          public Collection<Flow> getSuccessorFlows(Flow flow)

      Description copied from interface: `Cascade`
      Method getSuccessorFlows returns a Collection of all the Flow instances that will be executed after the given Flow instance.
      Specified by:
        `getSuccessorFlows` in interface `Cascade`
      Parameters:
        `flow` - of type Flow
      Returns:
        Collection

    - #### getPredecessorFlows

          public Collection<Flow> getPredecessorFlows(Flow flow)

      Description copied from interface: `Cascade`
      Method getPredecessorFlows returns a Collection of all the Flow instances that will be executed before the given Flow instance.
      Specified by:
        `getPredecessorFlows` in interface `Cascade`
      Parameters:
        `flow` - of type Flow
      Returns:
        Collection

    - #### findFlowsSourcingFrom

          public Collection<Flow> findFlowsSourcingFrom(String identifier)

      Description copied from interface: `Cascade`
      Method findFlowsSourcingFrom returns all Flow instances that reads from a source with the given identifier.
      Specified by:
        `findFlowsSourcingFrom` in interface `Cascade`
      Parameters:
        `identifier` - of type String
      Returns:
        Collection

    - #### findFlowsSinkingTo

          public Collection<Flow> findFlowsSinkingTo(String identifier)

      Description copied from interface: `Cascade`
      Method findFlowsSinkingTo returns all Flow instances that writes to a sink with the given identifier.
      Specified by:
        `findFlowsSinkingTo` in interface `Cascade`
      Parameters:
        `identifier` - of type String
      Returns:
        Collection

    - #### getFlowSkipStrategy

          public FlowSkipStrategy getFlowSkipStrategy()

      Description copied from interface: `Cascade`
      Method getFlowSkipStrategy returns the current `FlowSkipStrategy` used by this Flow.
      Specified by:
        `getFlowSkipStrategy` in interface `Cascade`
      Returns:
        FlowSkipStrategy

    - #### setFlowSkipStrategy

          public FlowSkipStrategy setFlowSkipStrategy(FlowSkipStrategy flowSkipStrategy)

      Description copied from interface: `Cascade`
      Method setFlowSkipStrategy sets a new `FlowSkipStrategy`, the current strategy, if any, is returned. If a strategy is given, it will be used as the strategy for all `BaseFlow` instances managed by this Cascade instance. To revert back to consulting the strategies associated with each Flow instance, re-set this value to `null`, its default value.

      FlowSkipStrategy instances define when a Flow instance should be skipped. The default strategy is `FlowSkipIfSinkNotStale` and is inherited from the Flow instance in question. An alternative strategy would be `FlowSkipIfSinkExists`.

      A FlowSkipStrategy will not be consulted when executing a Flow directly through `Cascade.start()`
      Specified by:
        `setFlowSkipStrategy` in interface `Cascade`
      Parameters:
        `flowSkipStrategy` - of type FlowSkipStrategy
      Returns:
        FlowSkipStrategy

    - #### prepare

          public void prepare()

      Specified by:
        `prepare` in interface `UnitOfWork<CascadeStats>`

    - #### start

          public void start()

      Description copied from interface: `Cascade`
      Method start begins the current Cascade process. It returns immediately. See method `Cascade.complete()` to block until the Cascade completes.
      Specified by:
        `start` in interface `Cascade`
      Specified by:
        `start` in interface `UnitOfWork<CascadeStats>`

    - #### complete

          public void complete()

      Description copied from interface: `Cascade`
      Method complete begins the current Cascade process if method `Cascade.start()` was not previously called. This method blocks until the process completes.
      Specified by:
        `complete` in interface `Cascade`
      Specified by:
        `complete` in interface `UnitOfWork<CascadeStats>`

    - #### stop

          public void stop()

      Specified by:
        `stop` in interface `Cascade`
      Specified by:
        `stop` in interface `UnitOfWork<CascadeStats>`

    - #### cleanup

          public void cleanup()

      Specified by:
        `cleanup` in interface `UnitOfWork<CascadeStats>`

    - #### writeDOT

          public void writeDOT(String filename)

      Description copied from interface: `Cascade`
      Method writeDOT writes this element graph to a DOT file for easy visualization and debugging.
      Specified by:
        `writeDOT` in interface `Cascade`
      Parameters:
        `filename` - of type String

    - #### printElementGraph

          protected void printElementGraph(String filename,
                               org.jgrapht.graph.SimpleDirectedGraph<String,BaseFlow.FlowHolder> graph)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### isInfoEnabled

          public boolean isInfoEnabled()

      Specified by:
        `isInfoEnabled` in interface `ProcessLogger`

    - #### isDebugEnabled

          public boolean isDebugEnabled()

      Specified by:
        `isDebugEnabled` in interface `ProcessLogger`

    - #### logInfo

          public void logInfo(String message,
                     Object... arguments)

      Specified by:
        `logInfo` in interface `ProcessLogger`

    - #### logDebug

          public void logDebug(String message,
                      Object... arguments)

      Specified by:
        `logDebug` in interface `ProcessLogger`

    - #### logWarn

          public void logWarn(String message)

      Specified by:
        `logWarn` in interface `ProcessLogger`

    - #### logWarn

          public void logWarn(String message,
                     Throwable throwable)

      Specified by:
        `logWarn` in interface `ProcessLogger`

    - #### logWarn

          public void logWarn(String message,
                     Object... arguments)

      Specified by:
        `logWarn` in interface `ProcessLogger`

    - #### logError

          public void logError(String message,
                      Object... arguments)

      Specified by:
        `logError` in interface `ProcessLogger`

    - #### logError

          public void logError(String message,
                      Throwable throwable)

      Specified by:
        `logError` in interface `ProcessLogger`

    - #### getSpawnStrategy

          public UnitOfWorkSpawnStrategy getSpawnStrategy()

      Specified by:
        `getSpawnStrategy` in interface `UnitOfWork<CascadeStats>`

    - #### setSpawnStrategy

          public void setSpawnStrategy(UnitOfWorkSpawnStrategy spawnStrategy)

      Specified by:
        `setSpawnStrategy` in interface `UnitOfWork<CascadeStats>`

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