Class ConsumerPool<M extends Message>
java.lang.Object
org.nuxeo.lib.stream.pattern.consumer.internals.AbstractCallablePool<ConsumerStatus>
org.nuxeo.lib.stream.pattern.consumer.ConsumerPool<M>
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
DocumentConsumerPool
Run a pool of ConsumerRunner.
- Since:
- 9.1
-
Field Summary
Modifier and TypeFieldDescriptionprotected final List<List<LogPartition>>
protected final ConsumerFactory<M>
protected final String
protected final LogManager
protected final ConsumerPolicy
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.internals.AbstractCallablePool
nbThreads, supplyThreadPool, threadPool
-
Constructor Summary
ConstructorDescriptionConsumerPool
(String logName, LogManager manager, Codec<M> codec, ConsumerFactory<M> factory, ConsumerPolicy policy) ConsumerPool
(String logName, LogManager manager, ConsumerFactory<M> factory, ConsumerPolicy policy) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterCall
(List<ConsumerStatus> ret) protected static short
computeNbThreads
(short maxConcurrency, short maxThreads) protected Callable<ConsumerStatus>
getCallable
(int i) protected List<List<LogPartition>>
protected ConsumerStatus
Value to return when there was an exception during executionprotected String
Methods inherited from class org.nuxeo.lib.stream.pattern.consumer.internals.AbstractCallablePool
close, getNbThreads, runPool, start
-
Field Details
-
logName
-
manager
-
codec
-
factory
-
policy
-
defaultAssignments
-
-
Constructor Details
-
ConsumerPool
@Deprecated public ConsumerPool(String logName, LogManager manager, ConsumerFactory<M> factory, ConsumerPolicy policy) Deprecated.since 11.1, due to serialization issue with java 11, useConsumerPool(String, LogManager, Codec, ConsumerFactory, ConsumerPolicy)
which allows to give acodec
totailer
. -
ConsumerPool
public ConsumerPool(String logName, LogManager manager, Codec<M> codec, ConsumerFactory<M> factory, ConsumerPolicy policy)
-
-
Method Details
-
computeNbThreads
protected static short computeNbThreads(short maxConcurrency, short maxThreads) -
getConsumerGroupName
-
getErrorStatus
Description copied from class:AbstractCallablePool
Value to return when there was an exception during execution- Specified by:
getErrorStatus
in classAbstractCallablePool<ConsumerStatus>
-
getCallable
- Specified by:
getCallable
in classAbstractCallablePool<ConsumerStatus>
-
getThreadPrefix
- Specified by:
getThreadPrefix
in classAbstractCallablePool<ConsumerStatus>
-
afterCall
- Specified by:
afterCall
in classAbstractCallablePool<ConsumerStatus>
-
getDefaultAssignments
-
ConsumerPool(String, LogManager, Codec, ConsumerFactory, ConsumerPolicy)
which allows to give acodec
totailer
.