|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.operation.BaseOperation<C>
public abstract class BaseOperation<C>
Class BaseOperation is the base class of predicate types that are applied to Tuple streams via
the Each or Every Pipe.
Function, Filter, Aggregator, Buffer,
and Assertion.
| Field Summary | |
|---|---|
protected Fields |
fieldDeclaration
Field fieldDeclaration |
protected int |
numArgs
Field numArgs |
protected String |
trace
Field trace |
| Fields inherited from interface cascading.operation.Operation |
|---|
ANY |
| Constructor Summary | |
|---|---|
protected |
BaseOperation()
Constructs a new instance that retuns an Fields.UNKNOWN Tuple and accepts any number of arguments. |
protected |
BaseOperation(Fields fieldDeclaration)
Constructs a new instance that returns the fields declared in fieldDeclaration and accepts any number of arguments. |
protected |
BaseOperation(int numArgs)
Constructs a new instance that returns an unknown field set and accepts the given numArgs number of arguments. |
protected |
BaseOperation(int numArgs,
Fields fieldDeclaration)
Constructs a new instance that returns the fields declared in fieldDeclaration and accepts numArgs number of arguments. |
| Method Summary | |
|---|---|
void |
cleanup(FlowProcess flowProcess,
OperationCall<C> operationCall)
Method cleanup does nothing, and may safely be overridden. |
boolean |
equals(Object object)
|
Fields |
getFieldDeclaration()
Returns the fields created by this Operation instance. |
int |
getNumArgs()
The minimum number of arguments this Operation expects from the calling Each or
Every Operator. |
String |
getTrace()
Method getTrace returns the trace of this BaseOperation object. |
int |
hashCode()
|
boolean |
isSafe()
Returns true if this Operation instance can safely execute on the same 'record' multiple
times, false otherwise. |
void |
prepare(FlowProcess flowProcess,
OperationCall<C> operationCall)
Method prepare does nothing, and may safely be overridden. |
static void |
printOperationInternal(Operation operation,
StringBuffer buffer,
Scope scope)
|
String |
toString()
|
static String |
toStringInternal(Operation operation)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Fields fieldDeclaration
protected int numArgs
protected String trace
| Constructor Detail |
|---|
protected BaseOperation()
Fields.UNKNOWN Tuple and accepts any number of arguments.
It is a best practice to always declare the field names and number of arguments via one of the other constructors.
protected BaseOperation(Fields fieldDeclaration)
fieldDeclaration - of type Fieldsprotected BaseOperation(int numArgs)
numArgs - of type numArgs
protected BaseOperation(int numArgs,
Fields fieldDeclaration)
numArgs - of type numArgsfieldDeclaration - of type Fields| Method Detail |
|---|
public void prepare(FlowProcess flowProcess,
OperationCall<C> operationCall)
prepare in interface Operation<C>
public void cleanup(FlowProcess flowProcess,
OperationCall<C> operationCall)
cleanup in interface Operation<C>public Fields getFieldDeclaration()
OperationFilter, it should always
return Fields.ALL.
getFieldDeclaration in interface Operation<C>Operation.getFieldDeclaration()public int getNumArgs()
OperationEach or
Every Operator.
Operations should be willing to receive more arguments than expected, but should ignore them if they are unused,
instead of failing.
getNumArgs in interface Operation<C>Operation.getNumArgs()public boolean isSafe()
Operationtrue if this Operation instance can safely execute on the same 'record' multiple
times, false otherwise.
That is, this Operation is safe if it has no side-effects, or if it does, they are idempotent.
If seeing the same 'record' more than once can cause errors (internally or externally),
this method must return false.
isSafe in interface Operation<C>Operation.isSafe()public String getTrace()
public String toString()
toString in class Objectpublic static String toStringInternal(Operation operation)
public static void printOperationInternal(Operation operation,
StringBuffer buffer,
Scope scope)
public boolean equals(Object object)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||