public abstract class AssertGroupBase extends BaseAssertion<AssertGroupBase.Context> implements GroupAssertion<AssertGroupBase.Context>
Modifier and Type | Class and Description |
---|---|
static class |
AssertGroupBase.Context |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
patternString
Field patternString
|
protected long |
size
Field size
|
fieldDeclaration, numArgs, trace
Modifier | Constructor and Description |
---|---|
|
AssertGroupBase(java.lang.String message,
long size) |
protected |
AssertGroupBase(java.lang.String message,
java.lang.String patternString,
long size) |
Modifier and Type | Method and Description |
---|---|
void |
aggregate(FlowProcess flowProcess,
GroupAssertionCall<AssertGroupBase.Context> assertionCall)
Method aggregate is called for each
TupleEntry value in the current grouping. |
protected abstract boolean |
assertFails(java.lang.Long groupSize) |
void |
doAssert(FlowProcess flowProcess,
GroupAssertionCall<AssertGroupBase.Context> assertionCall)
Method doAssert performs the assertion.
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getPatternString() |
long |
getSize() |
int |
hashCode() |
void |
prepare(FlowProcess flowProcess,
OperationCall<AssertGroupBase.Context> operationCall)
Method prepare does nothing, and may safely be overridden.
|
void |
start(FlowProcess flowProcess,
GroupAssertionCall<AssertGroupBase.Context> assertionCall)
Method start initializes the aggregation procedure and is called for every unique grouping.
|
fail, fail, getMessage, supportsPlannerLevel, throwFail, throwFail
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
supportsPlannerLevel
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
protected java.lang.String patternString
protected final long size
@ConstructorProperties(value={"message","size"}) public AssertGroupBase(java.lang.String message, long size)
@ConstructorProperties(value={"message","patternString","size"}) protected AssertGroupBase(java.lang.String message, java.lang.String patternString, long size)
public java.lang.String getPatternString()
public long getSize()
public void prepare(FlowProcess flowProcess, OperationCall<AssertGroupBase.Context> operationCall)
BaseOperation
prepare
in interface Operation<AssertGroupBase.Context>
prepare
in class BaseOperation<AssertGroupBase.Context>
public void start(FlowProcess flowProcess, GroupAssertionCall<AssertGroupBase.Context> assertionCall)
GroupAssertion
The AggregatorCall context should be initialized here if necessary.
The first time this method is called for a given 'process', the AggregatorCall context will be null. This method should set a new instance of the user defined context object. When the AggregatorCall context is not null, it is up to the developer to create a new instance, or 'recycle' the given instance. If recycled, it must be re-initialized to remove any previous state/values.
For example, if a Map is used to hold the intermediate data for each subsequent
GroupAssertion.aggregate(cascading.flow.FlowProcess, GroupAssertionCall)
call,
new HashMap() should be set on the AggregatorCall instance when OperationCall.getContext()
is null.
On the next grouping, start() will be called again, but this time with the old Map instance. In this case,
map.clear() should be invoked before returning.
start
in interface GroupAssertion<AssertGroupBase.Context>
flowProcess
- of type FlowProcessassertionCall
- of type GroupAssertionCallpublic void aggregate(FlowProcess flowProcess, GroupAssertionCall<AssertGroupBase.Context> assertionCall)
GroupAssertion
TupleEntry
value in the current grouping.aggregate
in interface GroupAssertion<AssertGroupBase.Context>
flowProcess
- of type FlowProcessassertionCall
- of type GroupAssertionCallpublic void doAssert(FlowProcess flowProcess, GroupAssertionCall<AssertGroupBase.Context> assertionCall)
GroupAssertion
doAssert
in interface GroupAssertion<AssertGroupBase.Context>
flowProcess
- of type FlowProcessassertionCall
- of type GroupAssertionCallprotected abstract boolean assertFails(java.lang.Long groupSize)
public boolean equals(java.lang.Object object)
equals
in class BaseAssertion<AssertGroupBase.Context>
public int hashCode()
hashCode
in class BaseAssertion<AssertGroupBase.Context>
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.