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 class
ComputationPool.NamedThreadFactory
-
Field Summary
Fields Modifier and Type Field Description protected List<List<LogPartition>>
defaultAssignments
protected ComputationMetadataMapping
metadata
protected ComputationPolicy
policy
protected List<ComputationRunner>
runners
protected LogStreamManager
streamManager
protected Supplier<Computation>
supplier
protected ExecutorService
threadPool
protected int
threads
-
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 boolean
awaitPoolTermination(Duration timeout)
boolean
drainAndStop(Duration timeout)
String
getComputationName()
long
getLowWatermark()
boolean
isTerminated()
void
shutdown()
void
start()
boolean
stop(Duration timeout)
boolean
waitForAssignments(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()
-
-