public class NearCacheConfigReadOnly extends NearCacheConfig
NearCacheConfig.LocalUpdatePolicy
DEFAULT_EVICTION_POLICY, DEFAULT_INVALIDATE_ON_CHANGE, DEFAULT_LOCAL_UPDATE_POLICY, DEFAULT_MAX_IDLE_SECONDS, DEFAULT_MAX_SIZE, DEFAULT_MEMORY_FORMAT, DEFAULT_SERIALIZE_KEYS, DEFAULT_TTL_SECONDS
Constructor and Description |
---|
NearCacheConfigReadOnly()
Deprecated.
|
NearCacheConfigReadOnly(NearCacheConfig config)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
EvictionConfig |
getEvictionConfig()
Deprecated.
Returns the eviction configuration for this Near Cache.
|
int |
getId()
Deprecated.
Returns type identifier for this class.
|
NearCachePreloaderConfig |
getPreloaderConfig()
Deprecated.
Returns the
NearCachePreloaderConfig of this Near Cache. |
NearCacheConfig |
setCacheLocalEntries(boolean cacheLocalEntries)
Deprecated.
Sets if local entries are also cached in the Near Cache.
|
NearCacheConfig |
setEvictionConfig(EvictionConfig evictionConfig)
Deprecated.
Sets the eviction configuration for this Near Cache.
|
NearCacheConfig |
setEvictionPolicy(String evictionPolicy)
Deprecated.
Sets the eviction policy.
|
NearCacheConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Deprecated.
Sets the data type used to store entries.
|
NearCacheConfig |
setInMemoryFormat(String inMemoryFormat)
Deprecated.
|
NearCacheConfig |
setInvalidateOnChange(boolean invalidateOnChange)
Deprecated.
Sets if Near Cache entries are invalidated when the entries in the backing data structure are changed
(updated or removed).
|
NearCacheConfig |
setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
Deprecated.
Sets the
NearCacheConfig.LocalUpdatePolicy of this Near Cache. |
NearCacheConfig |
setMaxIdleSeconds(int maxIdleSeconds)
Deprecated.
Set the maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
|
NearCacheConfig |
setMaxSize(int maxSize)
Deprecated.
Sets the maximum size of the Near Cache.
|
NearCacheConfig |
setName(String name)
Deprecated.
Sets the name of the Near Cache.
|
NearCacheConfig |
setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)
Deprecated.
Sets the
NearCachePreloaderConfig of this Near Cache. |
NearCacheConfig |
setSerializeKeys(boolean serializeKeys)
Deprecated.
Sets if the Near Cache key is stored in serialized format or by-reference.
|
NearCacheConfig |
setTimeToLiveSeconds(int timeToLiveSeconds)
Deprecated.
Returns the maximum number of seconds for each entry to stay in the Near Cache (time to live).
|
equals, getAsReadOnly, getEvictionPolicy, getFactoryId, getInMemoryFormat, getLocalUpdatePolicy, getMaxIdleSeconds, getMaxSize, getName, getTimeToLiveSeconds, hashCode, isCacheLocalEntries, isInvalidateOnChange, isSerializeKeys, readData, toString, writeData
public NearCacheConfigReadOnly()
public NearCacheConfigReadOnly(NearCacheConfig config)
public NearCacheConfig setName(String name)
NearCacheConfig
setName
in interface NamedConfig
setName
in class NearCacheConfig
name
- the name of the Near Cachepublic NearCacheConfig setTimeToLiveSeconds(int timeToLiveSeconds)
NearCacheConfig
Entries that are older than timeToLiveSeconds
will automatically be evicted from the Near Cache.
Accepts any integer between 0
and Integer.MAX_VALUE
.
The value 0
means Integer.MAX_VALUE
.
The default is 0
.
setTimeToLiveSeconds
in class NearCacheConfig
timeToLiveSeconds
- the maximum number of seconds for each entry to stay in the Near Cachepublic NearCacheConfig setMaxSize(int maxSize)
NearCacheConfig
When the maxSize is reached, the Near Cache is evicted based on the policy defined.
Accepts any integer between 0
and Integer.MAX_VALUE
.
The value 0
means Integer.MAX_VALUE
.
The default is 0
.
setMaxSize
in class NearCacheConfig
maxSize
- the maximum size of the Near Cachepublic NearCacheConfig setEvictionPolicy(String evictionPolicy)
NearCacheConfig
Valid values are:
LRU
(Least Recently Used)LFU
(Least Frequently Used)NONE
(no extra eviction, time-to-live-seconds or max-idle-seconds may still apply)RANDOM
(random entry)
LRU
is the default.
Regardless of the eviction policy used, time-to-live-seconds and max-idle-seconds will still apply.
setEvictionPolicy
in class NearCacheConfig
evictionPolicy
- the eviction policy for the Near Cachepublic NearCacheConfig setMaxIdleSeconds(int maxIdleSeconds)
NearCacheConfig
Entries that are not read (touched) more than maxIdleSeconds
value will get removed from the Near Cache.
Accepts any integer between 0
and Integer.MAX_VALUE
.
The value 0
means Integer.MAX_VALUE
.
The default is 0
.
setMaxIdleSeconds
in class NearCacheConfig
maxIdleSeconds
- maximum number of seconds each entry can stay in the Near Cache as untouched (not-read)public NearCacheConfig setSerializeKeys(boolean serializeKeys)
NearCacheConfig
NATIVE
.
You can still set this value to false
, but it will have no effect.setSerializeKeys
in class NearCacheConfig
serializeKeys
- true
if the key is stored in serialized format, false
if stored by-referencepublic NearCacheConfig setInvalidateOnChange(boolean invalidateOnChange)
NearCacheConfig
When this setting is enabled, a Hazelcast instance with a Near Cache listens for cluster-wide changes on the entries of the backing data structure and invalidates its corresponding Near Cache entries. Changes done on the local Hazelcast instance always invalidate the Near Cache immediately.
setInvalidateOnChange
in class NearCacheConfig
invalidateOnChange
- true
to enable Near Cache invalidations, false
otherwisepublic NearCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
NearCacheConfig
Possible values:
BINARY
: keys and values are stored as binary dataOBJECT
: values are stored in their object formsNATIVE
: keys and values are stored in native memoryBINARY
.setInMemoryFormat
in class NearCacheConfig
inMemoryFormat
- the data type used to store entriespublic NearCacheConfig setInMemoryFormat(String inMemoryFormat)
setInMemoryFormat
in class NearCacheConfig
public NearCacheConfig setCacheLocalEntries(boolean cacheLocalEntries)
NearCacheConfig
This is useful when the in-memory format of the Near Cache is different from the backing data structure. This setting has no meaning on Hazelcast clients, since they have no local entries.
setCacheLocalEntries
in class NearCacheConfig
cacheLocalEntries
- true
if local entries are also cached, false
otherwisepublic NearCacheConfig setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
NearCacheConfig
NearCacheConfig.LocalUpdatePolicy
of this Near Cache.
This is only implemented for JCache
data structures.
setLocalUpdatePolicy
in class NearCacheConfig
localUpdatePolicy
- the NearCacheConfig.LocalUpdatePolicy
of this Near Cachepublic NearCacheConfig setEvictionConfig(EvictionConfig evictionConfig)
NearCacheConfig
setEvictionConfig
in class NearCacheConfig
evictionConfig
- the eviction configurationpublic EvictionConfig getEvictionConfig()
NearCacheConfig
getEvictionConfig
in class NearCacheConfig
public NearCacheConfig setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)
NearCacheConfig
NearCachePreloaderConfig
of this Near Cache.setPreloaderConfig
in class NearCacheConfig
preloaderConfig
- the NearCachePreloaderConfig
of this Near Cachepublic NearCachePreloaderConfig getPreloaderConfig()
NearCacheConfig
NearCachePreloaderConfig
of this Near Cache.getPreloaderConfig
in class NearCacheConfig
NearCachePreloaderConfig
of this Near Cachepublic int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
getId
in class NearCacheConfig
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.