public class QueueConfig extends Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.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 synchronous 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) |
int |
getAsyncBackupCount()
Get the number of asynchronous backups for this queue.
|
int |
getBackupCount()
Get the number of synchronous backups for this queue.
|
int |
getClassId()
Returns type identifier for this class.
|
int |
getEmptyQueueTtl()
Returns the TTL (time to live) for emptying the Queue.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID 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() |
String |
getPriorityComparatorClassName()
Returns the class name that will be used to compare queue items.
|
QueueStoreConfig |
getQueueStoreConfig()
Get the QueueStore (load and store queue items from/to a database) configuration.
|
String |
getSplitBrainProtectionName()
Returns the split brain protection name for queue operations.
|
int |
getTotalBackupCount()
Get the total number of backups: the backup count plus the asynchronous backup count.
|
int |
hashCode() |
boolean |
isPriorityQueue()
Check if underlying implementation is a
PriorityQueue . |
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 |
setPriorityComparatorClassName(String priorityComparatorClassName)
Sets the class name that will be used to compare queue items.
|
QueueConfig |
setQueueStoreConfig(QueueStoreConfig queueStoreConfig)
Set the QueueStore (load and store queue items from/to a database) configuration.
|
QueueConfig |
setSplitBrainProtectionName(String splitBrainProtectionName)
Sets the split brain protection 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 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 valueIllegalArgumentException
- if the provided max size is negativepublic 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()
@Nullable public QueueStoreConfig getQueueStoreConfig()
public QueueConfig setQueueStoreConfig(@Nullable 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()
getName
in interface NamedConfig
public QueueConfig setName(String name)
setName
in interface NamedConfig
name
- the name to set for this queuepublic QueueConfig addItemListenerConfig(ItemListenerConfig listenerConfig)
listenerConfig
- the item listener configuration to add to this queue@Nonnull public List<ItemListenerConfig> getItemListenerConfigs()
public QueueConfig setItemListenerConfigs(@Nullable List<ItemListenerConfig> listenerConfigs)
listenerConfigs
- the list of item listener configurations to set for this queue@Nullable public String getSplitBrainProtectionName()
public QueueConfig setSplitBrainProtectionName(@Nullable String splitBrainProtectionName)
splitBrainProtectionName
- the split brain protection name@Nonnull public MergePolicyConfig getMergePolicyConfig()
MergePolicyConfig
for this queue.MergePolicyConfig
for this queuepublic QueueConfig setMergePolicyConfig(@Nonnull MergePolicyConfig mergePolicyConfig)
MergePolicyConfig
for this queue.public boolean isPriorityQueue()
PriorityQueue
. Otherwise
it is a FIFO queue.true
if priority queue has been configured, false
otherwise@Nullable public String getPriorityComparatorClassName()
If this value is non-null, then Hazelcast will ignore the queue store
QueueStoreConfig.STORE_MEMORY_LIMIT
configuration value.
public QueueConfig setPriorityComparatorClassName(@Nullable String priorityComparatorClassName)
QueueStoreConfig.STORE_MEMORY_LIMIT
configuration value.priorityComparatorClassName
- the class name that will be used to compare queue itemspublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
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 © 2024 Hazelcast, Inc.. All rights reserved.