cascading.pipe
Class SubAssembly

java.lang.Object
  extended by cascading.pipe.Pipe
      extended by cascading.pipe.SubAssembly
All Implemented Interfaces:
FlowElement, Serializable
Direct Known Subclasses:
AggregateBy, Coerce, Discard, Rename, Retain, Unique

public abstract class SubAssembly
extends Pipe

Subclasses of SubAssembly encapsulate complex assemblies of Pipes so they my be reused in the same manner a Pipe is used.

That is, a typical SubAssembly subclass will accept a 'previous' Pipe instance, and a few arguments for configuring the resulting sub-assembly.

If the SubAssembly represents a split in the pipeline process, all the 'tails' of the assembly must be passed to setTails(Pipe...).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class cascading.pipe.Pipe
configDef, previous, stepConfigDef
 
Constructor Summary
SubAssembly()
           
 
Method Summary
 ConfigDef getConfigDef()
          Returns a ConfigDef instance that allows for local properties to be set and made available via a resulting FlowProcess instance when the pipe is invoked.
 String getName()
          Get the name of this pipe.
 Pipe[] getPrevious()
          Get all the upstream pipes this pipe is connected to.
 ConfigDef getStepConfigDef()
          Returns a ConfigDef instance that allows for process level properties to be set and made available via a resulting FlowProcess instance when the pipe is invoked.
 String[] getTailNames()
          Method getTailNames returns the tailNames of this PipeAssembly object.
 Pipe[] getTails()
          Method getTails returns all the tails of this PipeAssembly object.
protected  void setTails(Pipe... tails)
          Must be called by subclasses to set the final end points of the assembly the subclass represents.
static Pipe[] unwind(Pipe... tails)
          Is responsible for unwinding nested PipeAssembly instances.
 
Methods inherited from class cascading.pipe.Pipe
equals, getHeads, getTrace, hasConfigDef, hashCode, hasStepConfigDef, isEquivalentTo, named, names, outgoingScopeFor, pipes, print, printInternal, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubAssembly

public SubAssembly()
Method Detail

setTails

protected void setTails(Pipe... tails)
Must be called by subclasses to set the final end points of the assembly the subclass represents.

Parameters:
tails - of type Pipe

getTails

public Pipe[] getTails()
Method getTails returns all the tails of this PipeAssembly object. These values are set by setTails(Pipe...).

Returns:
the tails (type Pipe[]) of this PipeAssembly object.

getTailNames

public String[] getTailNames()
Method getTailNames returns the tailNames of this PipeAssembly object.

Returns:
the tailNames (type String[]) of this PipeAssembly object.

getName

public String getName()
Description copied from class: Pipe
Get the name of this pipe. Guaranteed non-null.

Overrides:
getName in class Pipe
Returns:
String the name of this pipe

getPrevious

public Pipe[] getPrevious()
Description copied from class: Pipe
Get all the upstream pipes this pipe is connected to. This method will return the Pipe instances passed on the constructors as inputs to this Pipe instance.

Overrides:
getPrevious in class Pipe
Returns:
all the upstream pipes this pipe is connected to.

unwind

public static Pipe[] unwind(Pipe... tails)
Is responsible for unwinding nested PipeAssembly instances.

Parameters:
tails - of type Pipe[]
Returns:
a Pipe[]

getStepConfigDef

public ConfigDef getStepConfigDef()
Description copied from class: Pipe
Returns a ConfigDef instance that allows for process level properties to be set and made available via a resulting FlowProcess instance when the pipe is invoked.

Any properties set on the stepConfigDef will not show up in any Flow configuration, but will show up in the current process FlowStep (in Hadoop the MapReduce jobconf). Any value set in the stepConfigDef will be overridden by the pipe local #getConfigDef instance.

Use this method to tweak properties in the process step this pipe instance is planned into. In the case of the Hadoop platform, when set on a GroupBy instance, the number of reducers can be modified.

Specified by:
getStepConfigDef in interface FlowElement
Overrides:
getStepConfigDef in class Pipe
Returns:
an instance of ConfigDef

getConfigDef

public ConfigDef getConfigDef()
Description copied from class: Pipe
Returns a ConfigDef instance that allows for local properties to be set and made available via a resulting FlowProcess instance when the pipe is invoked.

Any properties set on the configDef will not show up in any Flow or FlowStep process level configuration, but will override any of those values as seen by the current Pipe instance.

Specified by:
getConfigDef in interface FlowElement
Overrides:
getConfigDef in class Pipe
Returns:
an instance of ConfigDef


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