Package nz.org.riskscape.engine.sched
Class AccumulatorSink
java.lang.Object
nz.org.riskscape.engine.sched.AccumulatorSink
- All Implemented Interfaces:
nz.org.riskscape.engine.pipeline.Sink
-
Nested Class Summary
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.pipeline.Sink
DEVNULL
-
Constructor Summary
ConstructorDescriptionAccumulatorSink
(List<nz.org.riskscape.engine.pipeline.Collector<?>> collectors) -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(nz.org.riskscape.engine.Tuple tuple) boolean
void
finish()
getAndClearAccumulator
(nz.org.riskscape.engine.pipeline.Collector forCollector) Returns the accumulator for a given collector.boolean
-
Constructor Details
-
AccumulatorSink
-
-
Method Details
-
accept
public boolean accept(nz.org.riskscape.engine.Tuple tuple) - Specified by:
accept
in interfacenz.org.riskscape.engine.pipeline.Sink
-
getAndClearAccumulator
Returns the accumulator for a given collector. This clears the accumulator for the sink (so that any tuples associated with the accumulator can eventually be garbage collected), so should only be called when the sink is finished.
-
finish
public void finish()- Specified by:
finish
in interfacenz.org.riskscape.engine.pipeline.Sink
-
isUnbounded
public boolean isUnbounded()- Specified by:
isUnbounded
in interfacenz.org.riskscape.engine.pipeline.Sink
-
canAccept
public boolean canAccept()- Specified by:
canAccept
in interfacenz.org.riskscape.engine.pipeline.Sink
-