cascading.pipe.joiner
Class JoinerClosure

java.lang.Object
  extended by cascading.pipe.joiner.JoinerClosure
Direct Known Subclasses:
MemoryCoGroupClosure

public abstract class JoinerClosure
extends Object

Class JoinerClosure wraps all incoming tuple streams with iterator instances allowing for just join implementations.

This class is provided to a Joiner.getIterator(JoinerClosure) implementation, or to a Buffer via the BufferCall.getJoinerClosure() method.

All iterators returned by getIterator(int) may be retrieved more than once to restart them except for the left most iterator at position 0 (zero).

This iterator may only be iterated across once. All other iterators are backed by memory and possibly disk.


Field Summary
protected  FlowProcess flowProcess
           
protected  Fields[] joinFields
           
protected  Fields[] valueFields
           
 
Constructor Summary
JoinerClosure(FlowProcess flowProcess, Fields[] joinFields, Fields[] valueFields)
           
 
Method Summary
 FlowProcess getFlowProcess()
           
abstract  Tuple getGroupTuple(Tuple keysTuple)
           
abstract  Iterator<Tuple> getIterator(int pos)
          Returns a Tuple Iterator for the given pipe position.
 Fields[] getJoinFields()
          Returns an array of Fields denoting the join fields or keys uses for each incoming pipe.
 Fields[] getValueFields()
          Returns an array of all the incoming fields for each incoming pipe.
abstract  boolean isEmpty(int pos)
           
 boolean isSelfJoin()
           
abstract  int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flowProcess

protected final FlowProcess flowProcess

joinFields

protected final Fields[] joinFields

valueFields

protected final Fields[] valueFields
Constructor Detail

JoinerClosure

public JoinerClosure(FlowProcess flowProcess,
                     Fields[] joinFields,
                     Fields[] valueFields)
Method Detail

getFlowProcess

public FlowProcess getFlowProcess()

getJoinFields

public Fields[] getJoinFields()
Returns an array of Fields denoting the join fields or keys uses for each incoming pipe.

The most left handed pipe will be in array position 0.

Returns:
an array of Fields

getValueFields

public Fields[] getValueFields()
Returns an array of all the incoming fields for each incoming pipe.

The most left handed pipe will be in array position 0;

Returns:
an array of Fields

isSelfJoin

public boolean isSelfJoin()

size

public abstract int size()

getIterator

public abstract Iterator<Tuple> getIterator(int pos)
Returns a Tuple Iterator for the given pipe position. Position 0 is the most left handed pipe passed to the prior CoGroup.

To restart an Iterator over a given pipe, this method must be called again.

Parameters:
pos - of type int
Returns:
an Iterator of Tuple instances.

isEmpty

public abstract boolean isEmpty(int pos)

getGroupTuple

public abstract Tuple getGroupTuple(Tuple keysTuple)


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