K
- the key typeV
- the value typepublic class CacheConfig<K,V> extends AbstractCacheConfig<K,V> implements SplitBrainMergeTypeProvider
ICache
.cacheLoaderFactory, cacheWriterFactory, classLoader, 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) |
CacheConfigReadOnly<K,V> |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
int |
getAsyncBackupCount()
Gets the number of asynchronous backups for this
ICache . |
int |
getBackupCount()
Gets the number of synchronous backups for this
ICache . |
CacheEvictionConfig |
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://". |
String |
getMergePolicy()
Gets the class name of
CacheMergePolicy implementation of this cache config. |
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.
|
Class |
getProvidedMergeTypes() |
String |
getQuorumName()
Gets the name of the associated quorum 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.
|
void |
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 . |
void |
setMergePolicy(String mergePolicy)
Sets the class name of
CacheMergePolicy implementation to this cache config. |
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> |
setQuorumName(String quorumName)
Associates this cache configuration to a quorum.
|
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, getExpiryPolicyFactory, getHotRestartConfig, getKeyClassName, getKeyType, getListenerConfigurations, getValueClassName, getValueType, hasListenerConfiguration, isManagementEnabled, isReadThrough, isStatisticsEnabled, isStoreByValue, isWriteThrough, keyValueTypesEqual, removeCacheEntryListenerConfiguration, setCacheLoaderFactory, setCacheWriterFactory, setClassLoader, setExpiryPolicyFactory, setHotRestartConfig, setKeyClassName, setKeyType, setListenerConfigurations, setListenerConfigurations, setManagementEnabled, setReadThrough, setStatisticsEnabled, setStoreByValue, setTypes, setValueClassName, setValueType, setWriteThrough
public CacheConfig()
public CacheConfig(String name)
public CacheConfig(CacheSimpleConfig simpleConfig) throws Exception
Exception
public CacheConfigReadOnly<K,V> getAsReadOnly()
public CacheConfig<K,V> setName(String name)
ICache
.name
- the name to set for this ICache
public String getManagerPrefix()
ICache
, such as "hz://".ICache
public CacheConfig<K,V> setManagerPrefix(String managerPrefix)
ICache
.managerPrefix
- the manager prefix to set for this ICache
public String getUriString()
ICache
.ICache
public CacheConfig<K,V> setUriString(String uriString)
ICache
.uriString
- the URI string to set for this ICache
public String getNameWithPrefix()
ICache
, including the manager scope prefix.ICache
, including the manager scope prefixpublic int getBackupCount()
ICache
.ICache
getAsyncBackupCount()
public CacheConfig<K,V> setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to set for this ICache
IllegalArgumentException
- 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
.ICache
setBackupCount(int)
public CacheConfig<K,V> setAsyncBackupCount(int asyncBackupCount)
ICache
.asyncBackupCount
- the number of asynchronous backups to set for this ICache
IllegalArgumentException
- 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 CacheEvictionConfig 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 null
public String getQuorumName()
public CacheConfig<K,V> setQuorumName(String quorumName)
quorumName
- name of the desired quorumpublic String getMergePolicy()
CacheMergePolicy
implementation of this cache config.CacheMergePolicy
implementation of this cache configpublic void setMergePolicy(String mergePolicy)
CacheMergePolicy
implementation to this cache config.mergePolicy
- the class name of CacheMergePolicy
implementation to be set to this cache
configpublic Class getProvidedMergeTypes()
getProvidedMergeTypes
in interface SplitBrainMergeTypeProvider
public boolean isDisablePerEntryInvalidationEvents()
true
if invalidation events are disabled for per entry, false
otherwisepublic void setDisablePerEntryInvalidationEvents(boolean disablePerEntryInvalidationEvents)
disablePerEntryInvalidationEvents
- disables invalidation event sending behaviour if it is true
,
otherwise enables itpublic 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.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
IOException
protected void readTenant(ObjectDataInput in) throws IOException
IOException
protected void writeKeyValueTypes(ObjectDataOutput out) throws IOException
IOException
protected void readKeyValueTypes(ObjectDataInput in) throws IOException
IOException
protected void writeFactories(ObjectDataOutput out) throws IOException
IOException
protected void readFactories(ObjectDataInput in) throws IOException
IOException
protected void writeListenerConfigurations(ObjectDataOutput out) throws IOException
IOException
protected void readListenerConfigurations(ObjectDataInput in) throws IOException
IOException
public <T extends CacheConfig<K,V>> T copy(T target, boolean resolved)
target
object whose type extends CacheConfig.target
- 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 © 2022 Hazelcast, Inc.. All Rights Reserved.