public class NearCacheConfig extends Object implements IdentifiedDataSerializable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
NearCacheConfig.LocalUpdatePolicy
Used to decide how to reflect local updates to near cache.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EVICTION_POLICY
Deprecated.
since 3.8, please use
EvictionConfig.DEFAULT_EVICTION_POLICY |
static int |
DEFAULT_MAX_IDLE_SECONDS
Default value of the idle time for eviction in seconds.
|
static int |
DEFAULT_MAX_SIZE
Deprecated.
since 3.8, please use
EvictionConfig.DEFAULT_MAX_ENTRY_COUNT_FOR_ON_HEAP_MAP |
static InMemoryFormat |
DEFAULT_MEMORY_FORMAT
Default value for the in-memory format.
|
static int |
DEFAULT_TTL_SECONDS
Default value of the time to live in seconds.
|
Constructor and Description |
---|
NearCacheConfig() |
NearCacheConfig(int timeToLiveSeconds,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat) |
NearCacheConfig(int timeToLiveSeconds,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat,
EvictionConfig evictionConfig) |
NearCacheConfig(int timeToLiveSeconds,
int maxSize,
String evictionPolicy,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat)
Deprecated.
since 3.8,
please use
NearCacheConfig(int, int, boolean, InMemoryFormat) |
NearCacheConfig(int timeToLiveSeconds,
int maxSize,
String evictionPolicy,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat,
EvictionConfig evictionConfig)
Deprecated.
since 3.8,
please use
NearCacheConfig(int, int, boolean, InMemoryFormat, EvictionConfig) |
NearCacheConfig(NearCacheConfig config) |
NearCacheConfig(String name) |
Modifier and Type | Method and Description |
---|---|
NearCacheConfigReadOnly |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only.
|
EvictionConfig |
getEvictionConfig()
The eviction configuration.
|
String |
getEvictionPolicy()
Deprecated.
since 3.8, use
getEvictionConfig() and EvictionConfig.getEvictionPolicy() instead |
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class.
|
int |
getId()
Returns type identifier for this class.
|
InMemoryFormat |
getInMemoryFormat()
Gets the data type used to store entries.
|
NearCacheConfig.LocalUpdatePolicy |
getLocalUpdatePolicy() |
int |
getMaxIdleSeconds()
Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
|
int |
getMaxSize()
Deprecated.
since 3.8, use
getEvictionConfig() and EvictionConfig.getSize() instead |
String |
getName()
Gets the name of the Near Cache.
|
NearCachePreloaderConfig |
getPreloaderConfig() |
int |
getTimeToLiveSeconds()
Gets the maximum number of seconds for each entry to stay in the Near Cache.
|
boolean |
isCacheLocalEntries()
If true, cache local entries also.
|
boolean |
isInvalidateOnChange()
True to evict the cached entries if the entries are changed (updated or removed).
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
NearCacheConfig |
setCacheLocalEntries(boolean cacheLocalEntries)
True to cache local entries also.
|
NearCacheConfig |
setEvictionConfig(EvictionConfig evictionConfig)
Sets the eviction configuration.
|
NearCacheConfig |
setEvictionPolicy(String evictionPolicy)
Deprecated.
since 3.8, use
setEvictionConfig(EvictionConfig)
and EvictionConfig.setEvictionPolicy(EvictionPolicy) instead |
NearCacheConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Sets the data type used to store entries.
|
NearCacheConfig |
setInMemoryFormat(String inMemoryFormat) |
NearCacheConfig |
setInvalidateOnChange(boolean invalidateOnChange)
True to evict the cached entries if the entries are changed (updated or removed).
|
NearCacheConfig |
setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy) |
NearCacheConfig |
setMaxIdleSeconds(int maxIdleSeconds)
Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
|
NearCacheConfig |
setMaxSize(int maxSize)
Deprecated.
since 3.8, use
setEvictionConfig(EvictionConfig) and EvictionConfig.setSize(int) instead |
NearCacheConfig |
setName(String name)
Sets the name of the Near Cache.
|
NearCacheConfig |
setPreloaderConfig(NearCachePreloaderConfig preloaderConfig) |
NearCacheConfig |
setTimeToLiveSeconds(int timeToLiveSeconds)
Sets the maximum number of seconds for each entry to stay in the Near Cache.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_TTL_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDS
public static final InMemoryFormat DEFAULT_MEMORY_FORMAT
public static final int DEFAULT_MAX_SIZE
EvictionConfig.DEFAULT_MAX_ENTRY_COUNT_FOR_ON_HEAP_MAP
public static final String DEFAULT_EVICTION_POLICY
EvictionConfig.DEFAULT_EVICTION_POLICY
public NearCacheConfig()
public NearCacheConfig(String name)
public NearCacheConfig(int timeToLiveSeconds, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat)
public NearCacheConfig(int timeToLiveSeconds, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat, EvictionConfig evictionConfig)
public NearCacheConfig(int timeToLiveSeconds, int maxSize, String evictionPolicy, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat)
NearCacheConfig(int, int, boolean, InMemoryFormat)
public NearCacheConfig(int timeToLiveSeconds, int maxSize, String evictionPolicy, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat, EvictionConfig evictionConfig)
NearCacheConfig(int, int, boolean, InMemoryFormat, EvictionConfig)
public NearCacheConfig(NearCacheConfig config)
public NearCacheConfigReadOnly getAsReadOnly()
public String getName()
public NearCacheConfig setName(String name)
name
- The name of the Near Cache.public int getTimeToLiveSeconds()
public NearCacheConfig setTimeToLiveSeconds(int timeToLiveSeconds)
timeToLiveSeconds
- The maximum number of seconds for each entry to stay in the Near Cache.public int getMaxSize()
getEvictionConfig()
and EvictionConfig.getSize()
insteadpublic NearCacheConfig setMaxSize(int maxSize)
setEvictionConfig(EvictionConfig)
and EvictionConfig.setSize(int)
insteadmaxSize
- The maximum number of seconds for each entry to stay in the Near Cache.public String getEvictionPolicy()
getEvictionConfig()
and EvictionConfig.getEvictionPolicy()
insteadpublic NearCacheConfig setEvictionPolicy(String evictionPolicy)
setEvictionConfig(EvictionConfig)
and EvictionConfig.setEvictionPolicy(EvictionPolicy)
insteadevictionPolicy
- The eviction policy for the Near Cache.public int getMaxIdleSeconds()
public NearCacheConfig setMaxIdleSeconds(int maxIdleSeconds)
maxIdleSeconds
- Maximum number of seconds each entry can stay in the Near Cache as
untouched (not-read).public boolean isInvalidateOnChange()
public NearCacheConfig setInvalidateOnChange(boolean invalidateOnChange)
invalidateOnChange
- True to evict the cached entries if the entries are
changed (updated or removed), false otherwise.public InMemoryFormat getInMemoryFormat()
public NearCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
inMemoryFormat
- The data type used to store entries.public boolean isCacheLocalEntries()
public NearCacheConfig setCacheLocalEntries(boolean cacheLocalEntries)
cacheLocalEntries
- True to cache local entries also.public NearCacheConfig.LocalUpdatePolicy getLocalUpdatePolicy()
public NearCacheConfig setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
public NearCacheConfig setInMemoryFormat(String inMemoryFormat)
public EvictionConfig getEvictionConfig()
public NearCacheConfig setEvictionConfig(EvictionConfig evictionConfig)
evictionConfig
- The eviction configuration.public NearCachePreloaderConfig getPreloaderConfig()
public NearCacheConfig setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.