K - the key typeV - the value typepublic class CacheConfig<K,V> extends AbstractCacheConfig<K,V>
ICache.cacheLoaderFactory, cacheWriterFactory, classLoader, eventJournalConfig, expiryPolicyFactory, hotRestartConfig, isManagementEnabled, isReadThrough, isStatisticsEnabled, isStoreByValue, isWriteThrough, listenerConfigurations, serializationService| Constructor and Description |
|---|
CacheConfig() |
CacheConfig(CacheSimpleConfig simpleConfig) |
CacheConfig(javax.cache.configuration.CompleteConfiguration<K,V> configuration) |
CacheConfig(String name) |
| Modifier and Type | Method and Description |
|---|---|
<T extends CacheConfig<K,V>> |
copy(T target,
boolean resolved)
Copy this CacheConfig to given
target object whose type extends CacheConfig. |
boolean |
equals(Object o) |
int |
getAsyncBackupCount()
Gets the number of asynchronous backups for this
ICache. |
int |
getBackupCount()
Gets the number of synchronous backups for this
ICache. |
int |
getClassId()
Returns type identifier for this class.
|
EvictionConfig |
getEvictionConfig()
Gets the
EvictionConfig instance of the eviction configuration for this ICache. |
InMemoryFormat |
getInMemoryFormat()
Gets the data type that will be used to store records.
|
String |
getManagerPrefix()
Gets the manager prefix of the
ICache, such as "hz://". |
MergePolicyConfig |
getMergePolicyConfig()
Gets the
MergePolicyConfig for this map. |
String |
getName()
Gets the name of this
ICache. |
String |
getNameWithPrefix()
Gets the full name of the
ICache, including the manager scope prefix. |
List<CachePartitionLostListenerConfig> |
getPartitionLostListenerConfigs()
Gets the partition lost listener references added to cache configuration.
|
String |
getSplitBrainProtectionName()
Gets the name of the associated split brain protection if any.
|
int |
getTotalBackupCount()
Gets the total backup count (
backupCount + asyncBackupCount) of the cache. |
String |
getUriString()
Gets the URI string which is the global identifier for this
ICache. |
WanReplicationRef |
getWanReplicationRef() |
int |
hashCode() |
boolean |
isDisablePerEntryInvalidationEvents()
Returns invalidation events disabled status for per entry.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
protected void |
readFactories(ObjectDataInput in) |
protected void |
readKeyValueTypes(ObjectDataInput in) |
protected void |
readListenerConfigurations(ObjectDataInput in) |
protected void |
readTenant(ObjectDataInput in) |
CacheConfig<K,V> |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups for this
ICache. |
CacheConfig<K,V> |
setBackupCount(int backupCount)
Sets the number of synchronous backups.
|
CacheConfig<K,V> |
setDisablePerEntryInvalidationEvents(boolean disablePerEntryInvalidationEvents)
Sets invalidation events disabled status for per entry.
|
CacheConfig<K,V> |
setEvictionConfig(EvictionConfig evictionConfig)
Sets the
EvictionConfig instance for eviction configuration for this ICache. |
CacheConfig<K,V> |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Data type that will be used to store records in this
ICache. |
CacheConfig<K,V> |
setManagerPrefix(String managerPrefix)
Sets the manager prefix of the
ICache. |
CacheConfig<K,V> |
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets the
MergePolicyConfig for this map. |
CacheConfig<K,V> |
setName(String name)
Sets the name of this
ICache. |
CacheConfig<K,V> |
setPartitionLostListenerConfigs(List<CachePartitionLostListenerConfig> partitionLostListenerConfigs)
Sets the WAN target replication reference.
|
CacheConfig<K,V> |
setSplitBrainProtectionName(String splitBrainProtectionName)
Associates this cache configuration to a split brain protection.
|
CacheConfig<K,V> |
setUriString(String uriString)
Sets the URI string, which is the global identifier of the
ICache. |
CacheConfig<K,V> |
setWanReplicationRef(WanReplicationRef wanReplicationRef) |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
protected void |
writeFactories(ObjectDataOutput out) |
protected void |
writeKeyValueTypes(ObjectDataOutput out) |
protected void |
writeListenerConfigurations(ObjectDataOutput out) |
protected void |
writeTenant(ObjectDataOutput out) |
addCacheEntryListenerConfiguration, createConcurrentSet, getCacheEntryListenerConfigurations, getCacheLoaderFactory, getCacheWriterFactory, getEventJournalConfig, getExpiryPolicyFactory, getFactoryId, getHotRestartConfig, getKeyClassName, getKeyType, getListenerConfigurations, getValueClassName, getValueType, hasListenerConfiguration, isManagementEnabled, isReadThrough, isStatisticsEnabled, isStoreByValue, isWriteThrough, keyValueTypesEqual, removeCacheEntryListenerConfiguration, setCacheLoaderFactory, setCacheWriterFactory, setClassLoader, setEventJournalConfig, setExpiryPolicyFactory, setHotRestartConfig, setKeyClassName, setKeyType, setListenerConfigurations, setListenerConfigurations, setManagementEnabled, setReadThrough, setStatisticsEnabled, setStoreByValue, setTypes, setValueClassName, setValueType, setWriteThroughpublic CacheConfig()
public CacheConfig(String name)
public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception
Exceptionpublic CacheConfig<K,V> setName(String name)
ICache.name - the name to set for this ICachepublic String getManagerPrefix()
ICache, such as "hz://".ICachepublic CacheConfig<K,V> setManagerPrefix(String managerPrefix)
ICache.managerPrefix - the manager prefix to set for this ICachepublic String getUriString()
ICache.ICachepublic CacheConfig<K,V> setUriString(String uriString)
ICache.uriString - the URI string to set for this ICachepublic String getNameWithPrefix()
ICache, including the manager scope prefix.ICache, including the manager scope prefixpublic int getBackupCount()
ICache.ICachegetAsyncBackupCount()public CacheConfig<K,V> setBackupCount(int backupCount)
backupCount - the number of synchronous backups to set for this ICacheIllegalArgumentException - if backupCount smaller than 0,
or larger than the maximum number of backup,
or the sum of the synchronous and asynchronous backups is larger than
the maximum number of backupssetAsyncBackupCount(int)public int getAsyncBackupCount()
ICache.ICachesetBackupCount(int)public CacheConfig<K,V> setAsyncBackupCount(int asyncBackupCount)
ICache.asyncBackupCount - the number of asynchronous backups to set for this ICacheIllegalArgumentException - if asyncBackupCount is smaller than 0,
or larger than the maximum number of backups,
or the sum of the synchronous and asynchronous backups is larger
than the maximum number of backupssetBackupCount(int),
getAsyncBackupCount()public int getTotalBackupCount()
backupCount + asyncBackupCount) of the cache.backupCount + asyncBackupCount) of the cachepublic EvictionConfig getEvictionConfig()
EvictionConfig instance of the eviction configuration for this ICache.EvictionConfig instance of the eviction configurationpublic CacheConfig<K,V> setEvictionConfig(EvictionConfig evictionConfig)
EvictionConfig instance for eviction configuration for this ICache.evictionConfig - the EvictionConfig instance to set for the eviction configurationpublic WanReplicationRef getWanReplicationRef()
public CacheConfig<K,V> setWanReplicationRef(WanReplicationRef wanReplicationRef)
public List<CachePartitionLostListenerConfig> getPartitionLostListenerConfigs()
public CacheConfig<K,V> setPartitionLostListenerConfigs(List<CachePartitionLostListenerConfig> partitionLostListenerConfigs)
partitionLostListenerConfigs - CachePartitionLostListenerConfig listpublic InMemoryFormat getInMemoryFormat()
public CacheConfig<K,V> setInMemoryFormat(InMemoryFormat inMemoryFormat)
ICache.
Possible values:
inMemoryFormat - the record type to setIllegalArgumentException - if inMemoryFormat is nullpublic String getSplitBrainProtectionName()
public CacheConfig<K,V> setSplitBrainProtectionName(String splitBrainProtectionName)
splitBrainProtectionName - name of the desired split brain protectionpublic MergePolicyConfig getMergePolicyConfig()
MergePolicyConfig for this map.MergePolicyConfig for this mappublic CacheConfig<K,V> setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
MergePolicyConfig for this map.public boolean isDisablePerEntryInvalidationEvents()
true if invalidation events are disabled for per entry, false otherwisepublic CacheConfig<K,V> setDisablePerEntryInvalidationEvents(boolean disablePerEntryInvalidationEvents)
disablePerEntryInvalidationEvents - disables invalidation event sending behaviour if it is true,
otherwise enables itpublic void writeData(ObjectDataOutput out) throws IOException
DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public int getClassId()
IdentifiedDataSerializablepublic void readData(ObjectDataInput in) throws IOException
DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.public int hashCode()
hashCode in class AbstractCacheConfig<K,V>public boolean equals(Object o)
equals in class AbstractCacheConfig<K,V>protected void writeTenant(ObjectDataOutput out) throws IOException
IOExceptionprotected void readTenant(ObjectDataInput in) throws IOException
IOExceptionprotected void writeKeyValueTypes(ObjectDataOutput out) throws IOException
IOExceptionprotected void readKeyValueTypes(ObjectDataInput in) throws IOException
IOExceptionprotected void writeFactories(ObjectDataOutput out) throws IOException
IOExceptionprotected void readFactories(ObjectDataInput in) throws IOException
IOExceptionprotected void writeListenerConfigurations(ObjectDataOutput out) throws IOException
IOExceptionprotected void readListenerConfigurations(ObjectDataInput in) throws IOException
IOExceptionpublic <T extends CacheConfig<K,V>> T copy(T target, boolean resolved)
target object whose type extends CacheConfig.T - the target object typetarget - the target object to which this configuration will be copiedresolved - when true, it is assumed that this cacheConfig's key-value types have already been
or will be resolved to loaded classes and the actual keyType and valueType will be copied.
Otherwise, this configuration's keyClassName and valueClassName will be copied to the
target config, to be resolved at a later time.Copyright © 2023 Hazelcast, Inc.. All rights reserved.