public class DefaultAsyncConfig extends Object implements AsyncConfig
| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH_SIZE |
static boolean |
BATCHING_ENABLED |
static long |
MAX_ALLOWED_FALLBEHIND |
static int |
MAX_QUEUE_SIZE |
static int |
RATE_LIMIT |
static long |
RETRY_ATTEMPT_DELAY |
static int |
RETRY_ATTEMPTS |
static boolean |
SYNCHRONOUS_WRITE |
static long |
WORK_DELAY |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultAsyncConfig() |
| Modifier and Type | Method and Description |
|---|---|
int |
getBatchSize()
The number of items to include in each batch when batching is enabled.
|
static AsyncConfig |
getInstance()
Return an
AsyncConfig instance representing the default configuration. |
long |
getMaxAllowedFallBehind()
The maximum amount of time that a queue is allowed to fall behind on the work that it's processing.
|
int |
getMaxQueueSize()
The maximum size of items the Async coordinator can hold.
|
int |
getRateLimit()
Sets the maximum number of operations to allow per second when
AsyncConfig.isBatchingEnabled() is enabled. |
long |
getRetryAttemptDelay()
Retrieves the number of milliseconds to wait before retrying a failed operation.
|
int |
getRetryAttempts()
Retrieves the number of times the processing of an item is retried.
|
long |
getWorkDelay()
Returns the minimum amount of time to wait between individual work cycles.
|
boolean |
isBatchingEnabled()
Indicates whether to batch items.
|
boolean |
isSynchronousWrite()
Perform all writes to the Terracotta backend in a synchronous fashion, hence increasing reliability but decreasing
performance.
|
public static final long WORK_DELAY
public static final long MAX_ALLOWED_FALLBEHIND
public static final int BATCH_SIZE
public static final boolean BATCHING_ENABLED
public static final boolean SYNCHRONOUS_WRITE
public static final int RETRY_ATTEMPTS
public static final long RETRY_ATTEMPT_DELAY
public static final int RATE_LIMIT
public static final int MAX_QUEUE_SIZE
public static AsyncConfig getInstance()
AsyncConfig instance representing the default configuration.public long getWorkDelay()
AsyncConfigThis allows work to accumulate in the write behind queue and be processed more efficiently.
getWorkDelay in interface AsyncConfigpublic long getMaxAllowedFallBehind()
AsyncConfiggetMaxAllowedFallBehind in interface AsyncConfigpublic int getBatchSize()
AsyncConfiggetBatchSize in interface AsyncConfigpublic boolean isBatchingEnabled()
AsyncConfigtrue, ItemProcessor.process(java.util.Collection) will
be called rather than ItemProcessor.process(Serializable) being called for individual item. Resources such as
databases can perform more efficiently if updates are batched, thus reducing load.isBatchingEnabled in interface AsyncConfigtrue if items should be batched; false otherwisepublic boolean isSynchronousWrite()
AsyncConfigisSynchronousWrite in interface AsyncConfigtrue to enable synchronous writes; or false to perform the write asynchronouslypublic int getRetryAttempts()
AsyncConfiggetRetryAttempts in interface AsyncConfigpublic long getRetryAttemptDelay()
AsyncConfiggetRetryAttemptDelay in interface AsyncConfigpublic int getRateLimit()
AsyncConfigAsyncConfig.isBatchingEnabled() is enabled.getRateLimit in interface AsyncConfigpublic int getMaxQueueSize()
AsyncConfiggetMaxQueueSize in interface AsyncConfigCopyright © 2003–2024 Terracotta, Inc.. All rights reserved.