Package org.ehcache.config.builders
Class WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder
java.lang.Object
org.ehcache.config.builders.WriteBehindConfigurationBuilder
org.ehcache.config.builders.WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder
- All Implemented Interfaces:
org.ehcache.config.Builder<org.ehcache.spi.loaderwriter.WriteBehindConfiguration<?>>
- Enclosing class:
- WriteBehindConfigurationBuilder
public static final class WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder
extends WriteBehindConfigurationBuilder
Specialized
WriteBehindConfigurationBuilder for WriteBehindConfigurations that supports batching-
Nested Class Summary
Nested classes/interfaces inherited from class org.ehcache.config.builders.WriteBehindConfigurationBuilder
WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder, WriteBehindConfigurationBuilder.UnBatchedWriteBehindConfigurationBuilder -
Field Summary
Fields inherited from class org.ehcache.config.builders.WriteBehindConfigurationBuilder
concurrency, queueSize, threadPoolAlias -
Method Summary
Modifier and TypeMethodDescriptionbatchSize(int batchSize) Updates the batch size on the returned builder.org.ehcache.spi.loaderwriter.WriteBehindConfiguration<?>build()Builds theWriteBehindConfigurationconcurrencyLevel(int concurrency) Sets the concurrency level on the returned builder.Disables batch coalescing on the returned builder.Enables batch coalescing on the returned builder.maxWriteDelay(long maxDelay, TimeUnit maxDelayUnit) Updates the max write delay on the returned builder.queueSize(int size) Sets the batch queue size on the returned builder.useThreadPool(String alias) Sets the thread pool to use for write behind on the returned builder.Methods inherited from class org.ehcache.config.builders.WriteBehindConfigurationBuilder
newBatchedWriteBehindConfiguration, newUnBatchedWriteBehindConfiguration
-
Method Details
-
enableCoalescing
Enables batch coalescing on the returned builder.- Returns:
- a new builder with batch coalescing enabled
- See Also:
-
disableCoalescing
Disables batch coalescing on the returned builder.- Returns:
- a new buidler with batch coalescing disabled
- See Also:
-
batchSize
public WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder batchSize(int batchSize) Updates the batch size on the returned builder.- Parameters:
batchSize- the new batch size- Returns:
- a new builder with updated batch size
-
maxWriteDelay
public WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder maxWriteDelay(long maxDelay, TimeUnit maxDelayUnit) Updates the max write delay on the returned builder.- Parameters:
maxDelay- the max delay amountmaxDelayUnit- the max delay unit- Returns:
- a new builder with updated max write delay
-
queueSize
Sets the batch queue size on the returned builder.Default queue size is
Integer.MAX_VALUE.- Specified by:
queueSizein classWriteBehindConfigurationBuilder- Parameters:
size- the new queue size- Returns:
- a new builder with updated queue size
-
concurrencyLevel
public WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder concurrencyLevel(int concurrency) Sets the concurrency level on the returned builder.Default concurrency is
1.- Specified by:
concurrencyLevelin classWriteBehindConfigurationBuilder- Parameters:
concurrency- the concurrency level- Returns:
- a new builder with the new concurrency level
-
useThreadPool
public WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder useThreadPool(String alias) Sets the thread pool to use for write behind on the returned builder.- Specified by:
useThreadPoolin classWriteBehindConfigurationBuilder- Parameters:
alias- the thread pool alias- Returns:
- a new builer with the configured thread pool alias
- See Also:
-
build
public org.ehcache.spi.loaderwriter.WriteBehindConfiguration<?> build()Builds theWriteBehindConfiguration- Returns:
- the write behind configuration
-