org.terracotta.modules.ehcache.async
Interface AsyncConfig

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultAsyncConfig, WriteBehindAsyncConfig

public interface AsyncConfig
extends Serializable


Method Summary
 int getBatchSize()
          The number of items to include in each batch when batching is enabled.
 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 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.
 

Method Detail

getWorkDelay

long getWorkDelay()
Returns the minimum amount of time to wait between individual work cycles.

This allows work to accumulate in the write behind queue and be processed more efficiently.

Returns:
the work delay that should be used, in milliseconds

getMaxAllowedFallBehind

long getMaxAllowedFallBehind()
The maximum amount of time that a queue is allowed to fall behind on the work that it's processing.

Returns:
the maximum of time that the queue is allowed to fall behind, in milliseconds

getBatchSize

int getBatchSize()
The number of items to include in each batch when batching is enabled. If there are less entries in the queue than the batch size, the queue length size is used.

Returns:
the amount of items to batch

isBatchingEnabled

boolean isBatchingEnabled()
Indicates whether to batch items. If set to true, ItemProcessor.process(java.util.Collection) will be called rather than ItemProcessor#process(Object) being called for individual item. Resources such as databases can perform more efficiently if updates are batched, thus reducing load.

Returns:
true if items should be batched; false otherwise

isSynchronousWrite

boolean isSynchronousWrite()
Perform all writes to the Terracotta backend in a synchronous fashion, hence increasing reliability but decreasing performance.

Returns:
true to enable synchronous writes; or false to perform the write asynchronously

getRetryAttempts

int getRetryAttempts()
Retrieves the number of times the processing of an item is retried.

Returns:
the number of tries before this pass is considered failed

getRetryAttemptDelay

long getRetryAttemptDelay()
Retrieves the number of milliseconds to wait before retrying a failed operation.

Returns:
the delay in between retries, in milliseconds

getRateLimit

int getRateLimit()
Sets the maximum number of operations to allow per second when isBatchingEnabled() is enabled.

Returns:
the rate limit

getMaxQueueSize

int getMaxQueueSize()
The maximum size of items the Async coordinator can hold.

Returns:


Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.