public class TrackingEventProcessorConfiguration extends Object
TrackingEventProcessor
. The TrackingEventProcessorConfiguration provides access to the options to tweak
various settings. Instances are not thread-safe and should not be altered after they have been used to initialize
a TrackingEventProcessor.Modifier and Type | Method and Description |
---|---|
TrackingEventProcessorConfiguration |
andBatchSize(int batchSize) |
TrackingEventProcessorConfiguration |
andInitialSegmentsCount(int segmentsSize) |
TrackingEventProcessorConfiguration |
andInitialTrackingToken(Function<StreamableMessageSource,TrackingToken> initialTrackingTokenBuilder)
Sets the Builder to use to create the initial tracking token.
|
TrackingEventProcessorConfiguration |
andThreadFactory(Function<String,ThreadFactory> threadFactory)
Sets the ThreadFactory to use to create the threads to process events on.
|
TrackingEventProcessorConfiguration |
andTokenClaimInterval(long tokenClaimInterval,
TimeUnit timeUnit)
Sets the time to wait after a failed attempt to claim any token, before making another attempt.
|
static TrackingEventProcessorConfiguration |
forParallelProcessing(int threadCount)
Initialize a configuration instance with the given
threadCount . |
static TrackingEventProcessorConfiguration |
forSingleThreadedProcessing()
Initialize a configuration with single threaded processing.
|
int |
getBatchSize() |
int |
getInitialSegmentsCount() |
Function<StreamableMessageSource,TrackingToken> |
getInitialTrackingToken() |
int |
getMaxThreadCount() |
ThreadFactory |
getThreadFactory(String processorName)
Provides the ThreadFactory to use to construct Threads for the processor with given
processorName |
long |
getTokenClaimInterval()
Returns the time, in milliseconds, the processor should wait after a failed attempt to claim any segments for
processing.
|
public static TrackingEventProcessorConfiguration forSingleThreadedProcessing()
public static TrackingEventProcessorConfiguration forParallelProcessing(int threadCount)
threadCount
. This is both the number of threads
that a processor will start for processing, as well as the initial number of segments that will be created when
the processor is first started.threadCount
- the number of segments to process in parallelpublic TrackingEventProcessorConfiguration andBatchSize(int batchSize)
batchSize
- The maximum number of events to process in a single batch.this
for method chainingpublic TrackingEventProcessorConfiguration andInitialSegmentsCount(int segmentsSize)
segmentsSize
- The number of segments requested for handling asynchronous processing of events.this
for method chainingpublic TrackingEventProcessorConfiguration andThreadFactory(Function<String,ThreadFactory> threadFactory)
threadFactory
- The factory to create threads withthis
for method chainingpublic TrackingEventProcessorConfiguration andInitialTrackingToken(Function<StreamableMessageSource,TrackingToken> initialTrackingTokenBuilder)
initialTrackingTokenBuilder
- The Builder of initial tracking tokenthis
for method chainingpublic TrackingEventProcessorConfiguration andTokenClaimInterval(long tokenClaimInterval, TimeUnit timeUnit)
tokenClaimInterval
- The time to wait in between attempts to claim a tokentimeUnit
- The unit of timethis
for method chainingpublic int getBatchSize()
public int getInitialSegmentsCount()
public Function<StreamableMessageSource,TrackingToken> getInitialTrackingToken()
public int getMaxThreadCount()
ThreadPoolExecutor.getCorePoolSize()
public ThreadFactory getThreadFactory(String processorName)
processorName
processorName
- The name of the processor for which to return the ThreadFactorypublic long getTokenClaimInterval()
andTokenClaimInterval(long, TimeUnit)
Copyright © 2010–2019. All rights reserved.