Class ComputationPool
- java.lang.Object
-
- org.nuxeo.lib.stream.computation.log.ComputationPool
-
public class ComputationPool extends Object
Pool of ComputationRunner- Since:
- 9.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classComputationPool.NamedThreadFactory
-
Field Summary
Fields Modifier and Type Field Description protected List<List<LogPartition>>defaultAssignmentsprotected ComputationMetadataMappingmetadataprotected ComputationPolicypolicyprotected List<ComputationRunner>runnersprotected LogStreamManagerstreamManagerprotected Supplier<Computation>supplierprotected ExecutorServicethreadPoolprotected intthreads
-
Constructor Summary
Constructors Constructor Description ComputationPool(Supplier<Computation> supplier, ComputationMetadataMapping metadata, List<List<LogPartition>> defaultAssignments, LogStreamManager streamManager, ComputationPolicy policy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanawaitPoolTermination(Duration timeout)booleandrainAndStop(Duration timeout)StringgetComputationName()longgetLowWatermark()booleanisTerminated()voidshutdown()voidstart()booleanstop(Duration timeout)booleanwaitForAssignments(Duration timeout)
-
-
-
Field Detail
-
metadata
protected final ComputationMetadataMapping metadata
-
threads
protected final int threads
-
supplier
protected final Supplier<Computation> supplier
-
defaultAssignments
protected final List<List<LogPartition>> defaultAssignments
-
runners
protected final List<ComputationRunner> runners
-
streamManager
protected final LogStreamManager streamManager
-
policy
protected final ComputationPolicy policy
-
threadPool
protected ExecutorService threadPool
-
-
Constructor Detail
-
ComputationPool
public ComputationPool(Supplier<Computation> supplier, ComputationMetadataMapping metadata, List<List<LogPartition>> defaultAssignments, LogStreamManager streamManager, ComputationPolicy policy)
-
-
Method Detail
-
getComputationName
public String getComputationName()
-
start
public void start()
-
isTerminated
public boolean isTerminated()
-
waitForAssignments
public boolean waitForAssignments(Duration timeout) throws InterruptedException
- Throws:
InterruptedException
-
drainAndStop
public boolean drainAndStop(Duration timeout)
-
stop
public boolean stop(Duration timeout)
-
shutdown
public void shutdown()
-
awaitPoolTermination
protected boolean awaitPoolTermination(Duration timeout)
-
getLowWatermark
public long getLowWatermark()
-
-