org.ehcache.config.writebehind
Class DefaultWriteBehindConfiguration

java.lang.Object
  extended by org.ehcache.config.writebehind.DefaultWriteBehindConfiguration
All Implemented Interfaces:
WriteBehindConfiguration, ServiceConfiguration<WriteBehindDecoratorLoaderWriterProvider>

public class DefaultWriteBehindConfiguration
extends java.lang.Object
implements WriteBehindConfiguration


Constructor Summary
DefaultWriteBehindConfiguration()
           
 
Method Summary
 int getMaxWriteDelay()
          The maximum number of seconds to wait before writing behind.
 int getMinWriteDelay()
          The minimum number of seconds to wait before writing behind.
 int getRateLimitPerSecond()
          The maximum number of write operations to allow per second.
 int getRetryAttemptDelaySeconds()
          A number of seconds to wait before retrying an failed operation.
 int getRetryAttempts()
          The number of times the write of a mapping will be retried in the case of failure.
 java.lang.Class<WriteBehindDecoratorLoaderWriterProvider> getServiceType()
          Indicates which service this configuration works with.
 int getWriteBatchSize()
          The recommended size of a batch of operations.
 int getWriteBehindConcurrency()
          A number of bucket/thread pairs configured for this cache's write behind.
 int getWriteBehindMaxQueueSize()
          The maximum number of operations allowed on the write behind queue.
 boolean isWriteCoalescing()
          Whether write operations can be coalesced.
 void setMaxWriteDelay(int maxWriteDelay)
           
 void setMinWriteDelay(int minWriteDelay)
           
 void setRateLimitPerSecond(int rateLimitPerSecond)
           
 void setRetryAttempts(int retryAttempts, int retryAttemptDelaySeconds)
           
 void setWriteBatchSize(int writeBatchSize)
           
 void setWriteBehindConcurrency(int writeBehindConcurrency)
           
 void setWriteBehindMaxQueueSize(int writeBehindMaxQueueSize)
           
 void setWriteCoalescing(boolean writeCoalescing)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWriteBehindConfiguration

public DefaultWriteBehindConfiguration()
Method Detail

getMinWriteDelay

public int getMinWriteDelay()
Description copied from interface: WriteBehindConfiguration
The minimum number of seconds to wait before writing behind. Lower than or equal to getMaxWriteDelay.

Specified by:
getMinWriteDelay in interface WriteBehindConfiguration
Returns:
Retrieves the minimum number of seconds to wait before writing behind

getMaxWriteDelay

public int getMaxWriteDelay()
Description copied from interface: WriteBehindConfiguration
The maximum number of seconds to wait before writing behind. Greater than or equal to getMinWriteDelay

Specified by:
getMaxWriteDelay in interface WriteBehindConfiguration
Returns:
Retrieves the maximum number of seconds to wait before writing behind

getRateLimitPerSecond

public int getRateLimitPerSecond()
Description copied from interface: WriteBehindConfiguration
The maximum number of write operations to allow per second. Only positive values are legal.

Specified by:
getRateLimitPerSecond in interface WriteBehindConfiguration
Returns:
Retrieves the maximum number of write operations to allow per second.

isWriteCoalescing

public boolean isWriteCoalescing()
Description copied from interface: WriteBehindConfiguration
Whether write operations can be coalesced.

Specified by:
isWriteCoalescing in interface WriteBehindConfiguration
Returns:
Retrieves the write coalescing behavior is enabled or not

getWriteBatchSize

public int getWriteBatchSize()
Description copied from interface: WriteBehindConfiguration
The recommended size of a batch of operations. Only positive values are legal. A value of 1 indicates that no batching should happen. Real batch size will be influenced by arrival frequency of operations and max write delay.

Specified by:
getWriteBatchSize in interface WriteBehindConfiguration
Returns:
Retrieves the size of the batch operation.

getRetryAttempts

public int getRetryAttempts()
Description copied from interface: WriteBehindConfiguration
The number of times the write of a mapping will be retried in the case of failure.

Specified by:
getRetryAttempts in interface WriteBehindConfiguration
Returns:
Retrieves the number of times the write of element is retried.

getRetryAttemptDelaySeconds

public int getRetryAttemptDelaySeconds()
Description copied from interface: WriteBehindConfiguration
A number of seconds to wait before retrying an failed operation.

Specified by:
getRetryAttemptDelaySeconds in interface WriteBehindConfiguration
Returns:
Retrieves the number of seconds to wait before retrying an failed operation.

getWriteBehindConcurrency

public int getWriteBehindConcurrency()
Description copied from interface: WriteBehindConfiguration
A number of bucket/thread pairs configured for this cache's write behind.

Specified by:
getWriteBehindConcurrency in interface WriteBehindConfiguration
Returns:
Retrieves the amount of bucket/thread pairs configured for this cache's write behind

getWriteBehindMaxQueueSize

public int getWriteBehindMaxQueueSize()
Description copied from interface: WriteBehindConfiguration
The maximum number of operations allowed on the write behind queue. Only positive values are legal.

Specified by:
getWriteBehindMaxQueueSize in interface WriteBehindConfiguration
Returns:
Retrieves the maximum amount of operations allowed on the write behind queue

setMinWriteDelay

public void setMinWriteDelay(int minWriteDelay)

setMaxWriteDelay

public void setMaxWriteDelay(int maxWriteDelay)

setRateLimitPerSecond

public void setRateLimitPerSecond(int rateLimitPerSecond)

setWriteCoalescing

public void setWriteCoalescing(boolean writeCoalescing)

setWriteBatchSize

public void setWriteBatchSize(int writeBatchSize)

setRetryAttempts

public void setRetryAttempts(int retryAttempts,
                             int retryAttemptDelaySeconds)

setWriteBehindConcurrency

public void setWriteBehindConcurrency(int writeBehindConcurrency)

setWriteBehindMaxQueueSize

public void setWriteBehindMaxQueueSize(int writeBehindMaxQueueSize)

getServiceType

public java.lang.Class<WriteBehindDecoratorLoaderWriterProvider> getServiceType()
Description copied from interface: ServiceConfiguration
Indicates which service this configuration works with.

Specified by:
getServiceType in interface ServiceConfiguration<WriteBehindDecoratorLoaderWriterProvider>
Returns:
the service type