T
- Type of Collection such as List, Setpublic abstract class CollectionConfig<T extends CollectionConfig> extends Object implements IdentifiedDataSerializable, NamedConfig
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ASYNC_BACKUP_COUNT
The default number of asynchronous backups
|
static int |
DEFAULT_MAX_SIZE
Default maximum size for the Configuration.
|
static int |
DEFAULT_SYNC_BACKUP_COUNT
The default number of synchronous backups
|
Modifier | Constructor and Description |
---|---|
protected |
CollectionConfig() |
protected |
CollectionConfig(CollectionConfig config) |
Modifier and Type | Method and Description |
---|---|
T |
addItemListenerConfig(ItemListenerConfig itemListenerConfig)
Adds an item listener to this collection (listens for when items are added or removed).
|
boolean |
equals(Object o) |
protected String |
fieldsToString()
Returns field names with values as concatenated String so it can be used in child classes' toString() methods.
|
int |
getAsyncBackupCount()
Gets the number of asynchronous backups.
|
int |
getBackupCount()
Gets the number of synchronous backups for this collection.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
List<ItemListenerConfig> |
getItemListenerConfigs()
Gets the list of ItemListenerConfigs.
|
int |
getMaxSize()
Gets the maximum size for the Configuration.
|
MergePolicyConfig |
getMergePolicyConfig()
Gets the
MergePolicyConfig for the collection. |
String |
getName()
Gets the name of this collection.
|
String |
getSplitBrainProtectionName()
Returns the split brain protection name for operations.
|
int |
getTotalBackupCount()
Gets the total number of synchronous and asynchronous backups for this collection.
|
int |
hashCode() |
boolean |
isStatisticsEnabled()
Checks if collection statistics are enabled.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
T |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
T |
setBackupCount(int backupCount)
Sets the number of synchronous backups for this collection.
|
T |
setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
Sets the list of ItemListenerConfigs.
|
T |
setMaxSize(int maxSize)
Sets the maximum size for the collection.
|
T |
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets the
MergePolicyConfig for the collection. |
T |
setName(String name)
Sets the name of this collection.
|
T |
setSplitBrainProtectionName(String splitBrainProtectionName)
Sets the split brain protection name for operations.
|
T |
setStatisticsEnabled(boolean statisticsEnabled)
Sets collection statistics to enabled or disabled.
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getClassId
public static final int DEFAULT_MAX_SIZE
public static final int DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNT
protected CollectionConfig()
protected CollectionConfig(CollectionConfig config)
public String getName()
getName
in interface NamedConfig
public T setName(String name)
setName
in interface NamedConfig
name
- the name of this collectionpublic List<ItemListenerConfig> getItemListenerConfigs()
public T setItemListenerConfigs(List<ItemListenerConfig> listenerConfigs)
listenerConfigs
- the list of ItemListenerConfigs to setpublic int getTotalBackupCount()
public int getBackupCount()
public T setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to set for this collectionIllegalArgumentException
- 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)
public int getAsyncBackupCount()
public T setAsyncBackupCount(int asyncBackupCount)
asyncBackupCount
- the number of asynchronous synchronous backups to setIllegalArgumentException
- if asyncBackupCount 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 backups.setBackupCount(int)
,
getAsyncBackupCount()
public int getMaxSize()
public T setMaxSize(int maxSize)
public boolean isStatisticsEnabled()
true
if collection statistics are enabled, false
otherwisepublic T setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- true
to enable collection statistics, false
to disablepublic T addItemListenerConfig(ItemListenerConfig itemListenerConfig)
itemListenerConfig
- the item listener to add to this collectionpublic String getSplitBrainProtectionName()
public T setSplitBrainProtectionName(String splitBrainProtectionName)
splitBrainProtectionName
- the split brain protection namepublic MergePolicyConfig getMergePolicyConfig()
MergePolicyConfig
for the collection.MergePolicyConfig
for the collectionpublic T setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
MergePolicyConfig
for the collection.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
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.protected String fieldsToString()
Copyright © 2023 Hazelcast, Inc.. All rights reserved.