Package org.aksw.commons.collector.core
Class AggErrorHandler<I,E,O,SUBACC extends Accumulator<I,E,O>,SUBAGG extends ParallelAggregator<I,E,O,SUBACC>>
java.lang.Object
org.aksw.commons.collector.core.AggErrorHandler<I,E,O,SUBACC,SUBAGG>
- All Implemented Interfaces:
Serializable,Aggregator<I,,E, O> ParallelAggregator<I,E, O, AggErrorHandler.AccError<I, E, O, SUBACC>>
public class AggErrorHandler<I,E,O,SUBACC extends Accumulator<I,E,O>,SUBAGG extends ParallelAggregator<I,E,O,SUBACC>>
extends Object
implements ParallelAggregator<I,E,O,AggErrorHandler.AccError<I,E,O,SUBACC>>, Serializable
Wraps another aggregator such that if accumulation fails with an exception
an error counter is increased. If the error counter is non zero then the accumulated value will always be null
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAggErrorHandler.AccError<I,E, O, SUBACC extends Accumulator<I, E, O>> class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to delegate accumulate calls to the sub-accumulator despite error.protected SUBAGG -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.collector.domain.Aggregator
accumulateAll, accumulateAll, accumulateAll, finishMethods inherited from interface org.aksw.commons.collector.domain.ParallelAggregator
asCollector, asCollector, combineRaw
-
Field Details
-
subAgg
-
errorValueExtractor
-
errorCallback
-
subAccDespiteError
protected boolean subAccDespiteErrorWhether to delegate accumulate calls to the sub-accumulator despite error. BEWARE when using en errorValueExtractor: If subAccDespiteError is false then combining accumulators will result in a null accumulator
-
-
Constructor Details
-
AggErrorHandler
-
-
Method Details
-
createAccumulator
- Specified by:
createAccumulatorin interfaceAggregator<I,E, O> - Specified by:
createAccumulatorin interfaceParallelAggregator<I,E, O, SUBACC extends Accumulator<I, E, O>>
-
combine
public AggErrorHandler.AccError<I,E, combineO, SUBACC> (AggErrorHandler.AccError<I, E, O, SUBACC> a, AggErrorHandler.AccError<I, E, O, SUBACC> b) Description copied from interface:ParallelAggregatorCombine accumulators. This method is allowed to mutate any of if its arguments, hence accumulators should be considered exhausted after combination.- Specified by:
combinein interfaceParallelAggregator<I,E, O, SUBACC extends Accumulator<I, E, O>> - Parameters:
a- First participant of combinationb- Second participant of combination- Returns:
- Combined accumulator
-
hashCode
public int hashCode() -
equals
-