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
public class ConsumerPool<M extends Message> extends AbstractCallablePool<ConsumerStatus>
Run a pool of ConsumerRunner.- Since:
- 9.1
-
-
Field Summary
Fields Modifier and Type Field Description protected Codec<M>
codec
protected List<List<LogPartition>>
defaultAssignments
protected ConsumerFactory<M>
factory
protected String
logName
protected LogManager
manager
protected ConsumerPolicy
policy
-
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.internals.AbstractCallablePool
nbThreads, supplyThreadPool, threadPool
-
-
Constructor Summary
Constructors Constructor Description ConsumerPool(String logName, LogManager manager, Codec<M> codec, ConsumerFactory<M> factory, ConsumerPolicy policy)
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
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterCall(List<ConsumerStatus> ret)
protected static short
computeNbThreads(short maxConcurrency, short maxThreads)
protected Callable<ConsumerStatus>
getCallable(int i)
Name
getConsumerGroupName()
protected List<List<LogPartition>>
getDefaultAssignments()
protected ConsumerStatus
getErrorStatus()
Value to return when there was an exception during executionprotected String
getThreadPrefix()
-
Methods inherited from class org.nuxeo.lib.stream.pattern.consumer.internals.AbstractCallablePool
close, getNbThreads, runPool, start
-
-
-
-
Field Detail
-
logName
protected final String logName
-
manager
protected final LogManager manager
-
factory
protected final ConsumerFactory<M extends Message> factory
-
policy
protected final ConsumerPolicy policy
-
defaultAssignments
protected final List<List<LogPartition>> defaultAssignments
-
-
Constructor Detail
-
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 Detail
-
computeNbThreads
protected static short computeNbThreads(short maxConcurrency, short maxThreads)
-
getConsumerGroupName
public Name getConsumerGroupName()
-
getErrorStatus
protected ConsumerStatus getErrorStatus()
Description copied from class:AbstractCallablePool
Value to return when there was an exception during execution- Specified by:
getErrorStatus
in classAbstractCallablePool<ConsumerStatus>
-
getCallable
protected Callable<ConsumerStatus> getCallable(int i)
- Specified by:
getCallable
in classAbstractCallablePool<ConsumerStatus>
-
getThreadPrefix
protected String getThreadPrefix()
- Specified by:
getThreadPrefix
in classAbstractCallablePool<ConsumerStatus>
-
afterCall
protected void afterCall(List<ConsumerStatus> ret)
- Specified by:
afterCall
in classAbstractCallablePool<ConsumerStatus>
-
getDefaultAssignments
protected List<List<LogPartition>> getDefaultAssignments()
-
-