com.hazelcast.config
@Beta public class RingbufferConfig extends Object
Ringbuffer
.
The RingBuffer is currently not a distributed data-structure, so its content will be fully stored on a single member
in the cluster and its backup in another member in the cluster.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ASYNC_BACKUP_COUNT
Default value of asynchronous backup count
|
static int |
DEFAULT_CAPACITY
Default value of capacity of the RingBuffer.
|
static InMemoryFormat |
DEFAULT_IN_MEMORY_FORMAT
Default value for the InMemoryFormat.
|
static int |
DEFAULT_SYNC_BACKUP_COUNT
Default value of synchronous backup count
|
static int |
DEFAULT_TTL_SECONDS
Default value for the time to live property.
|
Constructor and Description |
---|
RingbufferConfig(RingbufferConfig config)
Clones a RingbufferConfig
|
RingbufferConfig(String name)
Creates a RingbufferConfig with the provided name.
|
RingbufferConfig(String name,
RingbufferConfig config)
Creates a new RingbufferConfig by cloning an existing config and overriding the name.
|
Modifier and Type | Method and Description |
---|---|
RingbufferConfig |
getAsReadOnly()
Creates a readonly copy of this RingbufferConfig.
|
int |
getAsyncBackupCount()
Gets the number of asynchronous backups.
|
int |
getBackupCount()
Gets the number of synchronous backups.
|
int |
getCapacity()
Gets the capacity of the ringbuffer.
|
InMemoryFormat |
getInMemoryFormat()
Gets the InMemoryFormat.
|
String |
getName()
Returns the name of the ringbuffer.
|
int |
getTimeToLiveSeconds()
Gets the time to live in seconds.
|
int |
getTotalBackupCount()
Returns the total number of backups: backupCount plus asyncBackupCount.
|
RingbufferConfig |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
RingbufferConfig |
setBackupCount(int backupCount)
Sets the number of synchronous backups.
|
RingbufferConfig |
setCapacity(int capacity)
Sets the capacity of the ringbuffer.
|
RingbufferConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Sets the InMemoryFormat.
|
RingbufferConfig |
setTimeToLiveSeconds(int timeToLiveSeconds)
Sets the time to live in seconds.
|
String |
toString() |
public static final int DEFAULT_CAPACITY
public static final int DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNT
public static final int DEFAULT_TTL_SECONDS
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
public RingbufferConfig(String name)
name
- the nameNullPointerException
- if name is nullpublic RingbufferConfig(RingbufferConfig config)
config
- the ringbuffer config to cloneNullPointerException
- if config is nullpublic RingbufferConfig(String name, RingbufferConfig config)
name
- the new nameconfig
- the config.NullPointerException
- if name or config is null.public String getName()
public int getCapacity()
public RingbufferConfig setCapacity(int capacity)
capacity
- the capacity.IllegalArgumentException
- if capacity smaller than 1.getCapacity()
public int getBackupCount()
public RingbufferConfig setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to setIllegalArgumentException
- if backupCount smaller than 0,
or larger than the maximum number of backup
or the sum of the backups and async backups is larger than the maximum number of backupssetAsyncBackupCount(int)
,
getBackupCount()
public int getAsyncBackupCount()
public RingbufferConfig setAsyncBackupCount(int asyncBackupCount)
asyncBackupCount
- the number of asynchronous synchronous backups to setIllegalArgumentException
- if asyncBackupCount smaller than 0,
or larger than the maximum number of backup
or the sum of the backups and async backups is larger than the maximum number of backupssetBackupCount(int)
,
getAsyncBackupCount()
public int getTotalBackupCount()
public RingbufferConfig getAsReadOnly()
public int getTimeToLiveSeconds()
public RingbufferConfig setTimeToLiveSeconds(int timeToLiveSeconds)
timeToLiveSeconds
- the time to live period in secondsIllegalArgumentException
- if timeToLiveSeconds smaller than 0.public InMemoryFormat getInMemoryFormat()
public RingbufferConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
InMemoryFormat.OBJECT
: the item is stored in deserialized format (so a regular object)InMemoryFormat.BINARY
: the item is stored in serialized format (so a is binary blob) inMemoryFormat
- the new in memory format.NullPointerException
- if inMemoryFormat is null.IllegalArgumentException
- if InMemoryFormat.NATIVE
in memory format is selected.Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.