cascading.operation
Class ConcreteCall<C>

java.lang.Object
  extended by cascading.operation.ConcreteCall<C>
All Implemented Interfaces:
AggregatorCall<C>, BufferCall<C>, FilterCall<C>, FunctionCall<C>, GroupAssertionCall<C>, OperationCall<C>, ValueAssertionCall<C>

public class ConcreteCall<C>
extends Object
implements FunctionCall<C>, FilterCall<C>, AggregatorCall<C>, BufferCall<C>, ValueAssertionCall<C>, GroupAssertionCall<C>

Class OperationCall is the common base class for FunctionCall, FilterCall, AggregatorCall, ValueAssertionCall, and GroupAssertionCall.


Constructor Summary
ConcreteCall()
          Constructor OperationCall creates a new OperationCall instance.
ConcreteCall(ConcreteCall<C> concreteCall)
           
ConcreteCall(Fields argumentFields)
          Constructor ConcreteCall creates a new ConcreteCall instance.
ConcreteCall(Fields argumentFields, Fields declaredFields)
          Constructor ConcreteCall creates a new ConcreteCall instance.
ConcreteCall(TupleEntry arguments, TupleEntryCollector outputCollector)
          Constructor OperationCall creates a new OperationCall instance.
 
Method Summary
 Fields getArgumentFields()
          Returns the Fields of the expected arguments TupleEntry.
 TupleEntry getArguments()
          Returns TupleEntry of argument values.
 Iterator<TupleEntry> getArgumentsIterator()
          Returns an Iterator of TupleEntry instances representing the arguments for the called Buffer.operate(cascading.flow.FlowProcess, BufferCall) method.
 C getContext()
          Returns the user set context object, C.
 Fields getDeclaredFields()
          Return the resolved Fields declared by the current Operation.
 TupleEntry getGroup()
          Returns the current grouping TupleEntry.
 JoinerClosure getJoinerClosure()
          Returns the current instance of a JoinerClosure, if any.
 TupleEntryCollector getOutputCollector()
          Returns the TupleEntryCollector used to emit result values.
 boolean isRetainValues()
          Returns true if non-grouping fields will not be nulled after the argumentsIterator is completed.
 void setArgumentFields(Fields argumentFields)
           
 void setArguments(TupleEntry arguments)
           
 void setArgumentsIterator(Iterator<TupleEntry> argumentsIterator)
           
 void setContext(C context)
          Sets the user defined 'context' object.
 void setGroup(TupleEntry group)
           
 void setJoinerClosure(JoinerClosure joinerClosure)
           
 void setOutputCollector(TupleEntryCollector outputCollector)
           
 void setRetainValues(boolean retainValues)
          Set to false if at the end of all values iterated over in the argumentsIterator, the last seen argument tuple values should not be nulled out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcreteCall

public ConcreteCall()
Constructor OperationCall creates a new OperationCall instance.


ConcreteCall

public ConcreteCall(Fields argumentFields)
Constructor ConcreteCall creates a new ConcreteCall instance.

Parameters:
argumentFields - of type Fields

ConcreteCall

public ConcreteCall(Fields argumentFields,
                    Fields declaredFields)
Constructor ConcreteCall creates a new ConcreteCall instance.

Parameters:
argumentFields - of type Fields
declaredFields - of type Fields

ConcreteCall

public ConcreteCall(TupleEntry arguments,
                    TupleEntryCollector outputCollector)
Constructor OperationCall creates a new OperationCall instance.

Parameters:
arguments - of type TupleEntry
outputCollector - of type TupleCollector

ConcreteCall

public ConcreteCall(ConcreteCall<C> concreteCall)
Method Detail

getContext

public C getContext()
Description copied from interface: OperationCall
Returns the user set context object, C.

Specified by:
getContext in interface OperationCall<C>
Returns:
user defined object
See Also:
OperationCall.getContext()

setContext

public void setContext(C context)
Description copied from interface: OperationCall
Sets the user defined 'context' object.

Specified by:
setContext in interface OperationCall<C>
Parameters:
context - user defined object

getGroup

public TupleEntry getGroup()
Description copied from interface: AggregatorCall
Returns the current grouping TupleEntry.

Specified by:
getGroup in interface AggregatorCall<C>
Specified by:
getGroup in interface BufferCall<C>
Specified by:
getGroup in interface GroupAssertionCall<C>
Returns:
TupleEntry
See Also:
AggregatorCall.getGroup()

setGroup

public void setGroup(TupleEntry group)

getArgumentFields

public Fields getArgumentFields()
Description copied from interface: OperationCall
Returns the Fields of the expected arguments TupleEntry.

Specified by:
getArgumentFields in interface OperationCall<C>
Returns:
the argumentFields (type Fields) of this OperationCall object.

setArgumentFields

public void setArgumentFields(Fields argumentFields)

getArgumentsIterator

public Iterator<TupleEntry> getArgumentsIterator()
Description copied from interface: BufferCall
Returns an Iterator of TupleEntry instances representing the arguments for the called Buffer.operate(cascading.flow.FlowProcess, BufferCall) method.

The return value may be null if the previous CoGroup declares BufferJoin as the Joiner.

See BufferCall.getJoinerClosure().

Specified by:
getArgumentsIterator in interface BufferCall<C>
Returns:
Iterator
See Also:
BufferCall.getArgumentsIterator()

setArgumentsIterator

public void setArgumentsIterator(Iterator<TupleEntry> argumentsIterator)

getArguments

public TupleEntry getArguments()
Description copied from interface: FunctionCall
Returns TupleEntry of argument values.

Specified by:
getArguments in interface AggregatorCall<C>
Specified by:
getArguments in interface FilterCall<C>
Specified by:
getArguments in interface FunctionCall<C>
Specified by:
getArguments in interface GroupAssertionCall<C>
Specified by:
getArguments in interface ValueAssertionCall<C>
Returns:
TupleEntry
See Also:
FunctionCall.getArguments()

setArguments

public void setArguments(TupleEntry arguments)

getDeclaredFields

public Fields getDeclaredFields()
Description copied from interface: FunctionCall
Return the resolved Fields declared by the current Operation.

Specified by:
getDeclaredFields in interface AggregatorCall<C>
Specified by:
getDeclaredFields in interface BufferCall<C>
Specified by:
getDeclaredFields in interface FunctionCall<C>
Returns:
Fields

getOutputCollector

public TupleEntryCollector getOutputCollector()
Description copied from interface: FunctionCall
Returns the TupleEntryCollector used to emit result values.

Specified by:
getOutputCollector in interface AggregatorCall<C>
Specified by:
getOutputCollector in interface BufferCall<C>
Specified by:
getOutputCollector in interface FunctionCall<C>
Returns:
TupleCollector
See Also:
FunctionCall.getOutputCollector()

setOutputCollector

public void setOutputCollector(TupleEntryCollector outputCollector)

setRetainValues

public void setRetainValues(boolean retainValues)
Description copied from interface: BufferCall
Set to false if at the end of all values iterated over in the argumentsIterator, the last seen argument tuple values should not be nulled out.

By default, if a result is emitted from the Buffer before and after the argumentsIterator is started or completed, the last seen non-grouping values are null. When false, the values are not nulled after completion.

The default is true.

Specified by:
setRetainValues in interface BufferCall<C>
Parameters:
retainValues - of type boolean

isRetainValues

public boolean isRetainValues()
Description copied from interface: BufferCall
Returns true if non-grouping fields will not be nulled after the argumentsIterator is completed.

Specified by:
isRetainValues in interface BufferCall<C>
Returns:
true

setJoinerClosure

public void setJoinerClosure(JoinerClosure joinerClosure)

getJoinerClosure

public JoinerClosure getJoinerClosure()
Description copied from interface: BufferCall
Returns the current instance of a JoinerClosure, if any. This allows a Buffer to implement its own join strategy against the incoming tuple streams.

The return value is always null unless the declared fields on the CoGroup are Fields.NONE.

Note this method is provided as a means to bypass some of the Cascading internals in order to improve the implementations (performance or maintainability) behind some algorithms.

Consider it only if you are an advanced user. Or more robustly, consider implementing a custom Joiner.

Specified by:
getJoinerClosure in interface BufferCall<C>
Returns:
JoinerClosure


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