public class NearCacheConfig extends Object implements DataSerializable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
NearCacheConfig.LocalUpdatePolicy
Local Update Policy enum.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EVICTION_POLICY
Default eviction policy
|
static int |
DEFAULT_MAX_IDLE_SECONDS
Default value of idle in seconds for eviction.
|
static int |
DEFAULT_MAX_SIZE
Default value of maximum size
|
static InMemoryFormat |
DEFAULT_MEMORY_FORMAT
Default memory format
|
static int |
DEFAULT_TTL_SECONDS
Default value of time to live in seconds.
|
Constructor and Description |
---|
NearCacheConfig() |
NearCacheConfig(int timeToLiveSeconds,
int maxSize,
String evictionPolicy,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat) |
NearCacheConfig(int timeToLiveSeconds,
int maxSize,
String evictionPolicy,
int maxIdleSeconds,
boolean invalidateOnChange,
InMemoryFormat inMemoryFormat,
EvictionConfig evictionConfig) |
NearCacheConfig(NearCacheConfig config) |
NearCacheConfig(String name) |
Modifier and Type | Method and Description |
---|---|
NearCacheConfigReadOnly |
getAsReadOnly() |
EvictionConfig |
getEvictionConfig()
The eviction policy.
|
String |
getEvictionPolicy()
The eviction policy for the near cache.
|
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()
Gets the maximum size of the near cache.
|
String |
getName()
Gets the name of the near cache.
|
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)
The eviction policy.
|
NearCacheConfig |
setEvictionPolicy(String evictionPolicy)
Valid values are:
NONE (no extra eviction, time-to-live-seconds may still apply),
LRU (Least Recently Used),
LFU (Least Frequently Used).
|
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)
Sets the maximum size of the near cache.
|
NearCacheConfig |
setName(String name)
Sets the name of the near cache.
|
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 int DEFAULT_MAX_SIZE
public static final String DEFAULT_EVICTION_POLICY
public static final InMemoryFormat DEFAULT_MEMORY_FORMAT
public NearCacheConfig()
public NearCacheConfig(String name)
public NearCacheConfig(int timeToLiveSeconds, int maxSize, String evictionPolicy, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat)
public NearCacheConfig(int timeToLiveSeconds, int maxSize, String evictionPolicy, int maxIdleSeconds, boolean invalidateOnChange, InMemoryFormat inMemoryFormat, EvictionConfig 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()
public NearCacheConfig setMaxSize(int maxSize)
maxSize
- The maximum number of seconds for each entry to stay in the near cache.public String getEvictionPolicy()
public NearCacheConfig setEvictionPolicy(String evictionPolicy)
evictionPolicy
- 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 policy.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 © 2016 Hazelcast, Inc.. All Rights Reserved.