public class QueueConfig extends Object implements SplitBrainMergeTypeProvider, IdentifiedDataSerializable, Versioned
IQueue
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ASYNC_BACKUP_COUNT
Default value of the asynchronous backup count.
|
static int |
DEFAULT_EMPTY_QUEUE_TTL
Default value for the TTL (time to live) for empty Queue.
|
static int |
DEFAULT_MAX_SIZE
Default value for the maximum size of the Queue.
|
static int |
DEFAULT_SYNC_BACKUP_COUNT
Default value for the sychronous backup count.
|
Constructor and Description |
---|
QueueConfig() |
QueueConfig(QueueConfig config) |
QueueConfig(String name) |
Modifier and Type | Method and Description |
---|---|
QueueConfig |
addItemListenerConfig(ItemListenerConfig listenerConfig)
Add an item listener configuration to this queue.
|
boolean |
equals(Object o) |
QueueConfigReadOnly |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
int |
getAsyncBackupCount()
Get the number of asynchronous backups for this queue.
|
int |
getBackupCount()
Get the number of synchronous backups for this queue.
|
int |
getEmptyQueueTtl()
Returns the TTL (time to live) for emptying the Queue.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
List<ItemListenerConfig> |
getItemListenerConfigs()
Get the list of item listener configurations for this queue.
|
int |
getMaxSize()
Returns the maximum size of the Queue.
|
MergePolicyConfig |
getMergePolicyConfig()
Gets the
MergePolicyConfig for this queue. |
String |
getName() |
Class |
getProvidedMergeTypes() |
QueueStoreConfig |
getQueueStoreConfig()
Get the QueueStore (load and store queue items from/to a database) configuration.
|
String |
getQuorumName()
Returns the quorum name for queue operations.
|
int |
getTotalBackupCount()
Get the total number of backups: the backup count plus the asynchronous backup count.
|
int |
hashCode() |
boolean |
isStatisticsEnabled()
Check if statistics are enabled for this queue.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
QueueConfig |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
QueueConfig |
setBackupCount(int backupCount)
Sets the number of synchronous backups for this queue.
|
QueueConfig |
setEmptyQueueTtl(int emptyQueueTtl)
Sets the TTL (time to live) for emptying the Queue.
|
QueueConfig |
setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
Set the list of item listener configurations for this queue.
|
QueueConfig |
setMaxSize(int maxSize)
Sets the maximum size of the Queue.
|
QueueConfig |
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets the
MergePolicyConfig for this queue. |
QueueConfig |
setName(String name)
Set the name for this queue.
|
QueueConfig |
setQueueStoreConfig(QueueStoreConfig queueStoreConfig)
Set the QueueStore (load and store queue items from/to a database) configuration.
|
QueueConfig |
setQuorumName(String quorumName)
Sets the quorum name for queue operations.
|
QueueConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics for this queue.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_MAX_SIZE
public static final int DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNT
public static final int DEFAULT_EMPTY_QUEUE_TTL
public QueueConfig()
public QueueConfig(String name)
public QueueConfig(QueueConfig config)
public QueueConfigReadOnly getAsReadOnly()
public int getEmptyQueueTtl()
public QueueConfig setEmptyQueueTtl(int emptyQueueTtl)
emptyQueueTtl
- set the TTL (time to live) for emptying the Queue to this valuepublic int getMaxSize()
public QueueConfig setMaxSize(int maxSize)
maxSize
- set the maximum size of the Queue to this valuepublic int getTotalBackupCount()
public int getBackupCount()
public QueueConfig setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to setIllegalArgumentException
- if backupCount is smaller than 0,
or larger than the maximum number of backups,
or the sum of the backups and async backups is larger than the maximum number of backupssetAsyncBackupCount(int)
public int getAsyncBackupCount()
public QueueConfig 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 QueueStoreConfig getQueueStoreConfig()
public QueueConfig setQueueStoreConfig(QueueStoreConfig queueStoreConfig)
queueStoreConfig
- set the QueueStore configuration to this configurationpublic boolean isStatisticsEnabled()
true
if statistics are enabled, false
otherwisepublic QueueConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- true
to enable statistics for this queue, false
to disablepublic String getName()
public QueueConfig setName(String name)
name
- the name to set for this queuepublic QueueConfig addItemListenerConfig(ItemListenerConfig listenerConfig)
listenerConfig
- the item listener configuration to add to this queuepublic List<ItemListenerConfig> getItemListenerConfigs()
public QueueConfig setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
listenerConfigs
- the list of item listener configurations to set for this queuepublic String getQuorumName()
public QueueConfig setQuorumName(String quorumName)
quorumName
- the quorum namepublic MergePolicyConfig getMergePolicyConfig()
MergePolicyConfig
for this queue.MergePolicyConfig
for this queuepublic QueueConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
MergePolicyConfig
for this queue.public Class getProvidedMergeTypes()
getProvidedMergeTypes
in interface SplitBrainMergeTypeProvider
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.