public class QueryCacheConfig extends Object implements IdentifiedDataSerializable
QueryCache
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_SIZE
By default, after reaching this minimum size, node immediately sends buffered events to
QueryCache . |
static int |
DEFAULT_BUFFER_SIZE
By default, only buffer last
DEFAULT_BUFFER_SIZE events fired from a partition. |
static boolean |
DEFAULT_COALESCE
Default value of coalesce property.
|
static int |
DEFAULT_DELAY_SECONDS
Default value of delay seconds which an event wait in the buffer of a node, before sending to
QueryCache . |
static InMemoryFormat |
DEFAULT_IN_MEMORY_FORMAT
By default, hold values of entries in
QueryCache as binary. |
static boolean |
DEFAULT_INCLUDE_VALUE
By default, also cache values of entries besides keys.
|
static boolean |
DEFAULT_POPULATE
By default, execute an initial population query prior to creation of the
QueryCache . |
static boolean |
DEFAULT_SERIALIZE_KEYS
Do not serialize given keys by default.
|
Constructor and Description |
---|
QueryCacheConfig() |
QueryCacheConfig(QueryCacheConfig other) |
QueryCacheConfig(String name) |
Modifier and Type | Method and Description |
---|---|
QueryCacheConfig |
addEntryListenerConfig(EntryListenerConfig listenerConfig)
Adds
EntryListenerConfig to this QueryCacheConfig . |
QueryCacheConfig |
addIndexConfig(IndexConfig indexConfig) |
boolean |
equals(Object o) |
int |
getBatchSize()
After reaching this size, node sends buffered events to
QueryCache . |
int |
getBufferSize()
Returns the maximum number of events which can be stored in a buffer of partition.
|
int |
getClassId()
Returns type identifier for this class.
|
int |
getDelaySeconds()
Returns the minimum number of delay seconds which an event waits in the buffer of node
before sending to a
QueryCache |
List<EntryListenerConfig> |
getEntryListenerConfigs() |
EvictionConfig |
getEvictionConfig()
Returns
EvictionConfig instance for this QueryCache |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
List<IndexConfig> |
getIndexConfigs() |
InMemoryFormat |
getInMemoryFormat()
Returns memory format of values of entries in
QueryCache . |
String |
getName()
Returns the name of
QueryCache . |
PredicateConfig |
getPredicateConfig()
Returns the predicate of
QueryCache . |
int |
hashCode() |
boolean |
isCoalesce()
Returns
true if coalescing is is enabled, otherwise returns false . |
boolean |
isIncludeValue()
Returns
true if value caching enabled, otherwise returns false . |
boolean |
isPopulate()
Returns
true if initial population of QueryCache is enabled, otherwise returns false . |
boolean |
isSerializeKeys()
Checks if the
QueryCache
key is stored in serialized format or by-reference. |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
QueryCacheConfig |
setBatchSize(int batchSize)
Sets the batch size which will be used to determine number of events to be sent in a batch to
QueryCache |
QueryCacheConfig |
setBufferSize(int bufferSize)
Sets the maximum number of events which can be stored in a buffer of partition.
|
QueryCacheConfig |
setCoalesce(boolean coalesce)
Set
true to enable coalescing, otherwise set false . |
QueryCacheConfig |
setDelaySeconds(int delaySeconds)
Sets the minimum number of delay seconds which an event waits in the buffer of node
before sending to a
QueryCache |
QueryCacheConfig |
setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) |
QueryCacheConfig |
setEvictionConfig(EvictionConfig evictionConfig)
Sets the
EvictionConfig instance for this QueryCache |
QueryCacheConfig |
setIncludeValue(boolean includeValue)
Set
true to enable value caching, otherwise set false |
QueryCacheConfig |
setIndexConfigs(List<IndexConfig> indexConfigs) |
QueryCacheConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Sets memory format of values of entries in
QueryCache . |
QueryCacheConfig |
setName(String name)
Sets the name of
QueryCache . |
QueryCacheConfig |
setPopulate(boolean populate)
Set
true to enable initial population, otherwise set false . |
QueryCacheConfig |
setPredicateConfig(PredicateConfig predicateConfig)
Sets the predicate of
QueryCache . |
QueryCacheConfig |
setSerializeKeys(boolean serializeKeys)
Sets if the
QueryCache
key is stored in serialized format or by-reference. |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_BATCH_SIZE
QueryCache
.public static final int DEFAULT_BUFFER_SIZE
DEFAULT_BUFFER_SIZE
events fired from a partition.public static final int DEFAULT_DELAY_SECONDS
QueryCache
.public static final boolean DEFAULT_INCLUDE_VALUE
public static final boolean DEFAULT_POPULATE
QueryCache
.public static final boolean DEFAULT_COALESCE
public static final boolean DEFAULT_SERIALIZE_KEYS
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
QueryCache
as binary.public QueryCacheConfig()
public QueryCacheConfig(String name)
public QueryCacheConfig(QueryCacheConfig other)
public String getName()
QueryCache
.QueryCache
public QueryCacheConfig setName(String name)
QueryCache
.name
- the name of QueryCache
QueryCacheConfig
instancepublic PredicateConfig getPredicateConfig()
QueryCache
.QueryCache
public QueryCacheConfig setPredicateConfig(PredicateConfig predicateConfig)
QueryCache
.predicateConfig
- config for predicateQueryCacheConfig
instancepublic int getBatchSize()
QueryCache
.public QueryCacheConfig setBatchSize(int batchSize)
QueryCache
batchSize
- the batch sizeQueryCacheConfig
instancepublic int getBufferSize()
public QueryCacheConfig setBufferSize(int bufferSize)
bufferSize
- the buffer sizeQueryCacheConfig
instancepublic int getDelaySeconds()
QueryCache
public QueryCacheConfig setDelaySeconds(int delaySeconds)
QueryCache
delaySeconds
- the delay secondsQueryCacheConfig
instancepublic InMemoryFormat getInMemoryFormat()
QueryCache
.
Default value is binary.
QueryCache
public QueryCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
QueryCache
.
Default value is binary.
inMemoryFormat
- the memory formatQueryCacheConfig
instancepublic boolean isIncludeValue()
true
if value caching enabled, otherwise returns false
public QueryCacheConfig setIncludeValue(boolean includeValue)
includeValue
- Set true
if value caching is enabled, otherwise set false
QueryCacheConfig
instancepublic boolean isPopulate()
true
if initial population of QueryCache
is enabled, otherwise returns false
.
Default value is true.
true
if initial population of QueryCache
is enabled, otherwise returns false
public QueryCacheConfig setPopulate(boolean populate)
populate
- set true
to enable initial population, otherwise set false
QueryCacheConfig
instancepublic boolean isCoalesce()
true
if coalescing is is enabled, otherwise returns false
setCoalesce(boolean)
public QueryCacheConfig setCoalesce(boolean coalesce)
true
to enable coalescing, otherwise set false
.
This setting is only valid if QueryCacheConfig#delaySeconds
is greater than 0.
Default value is false.
coalesce
- set true
to enable, otherwise set false
public boolean isSerializeKeys()
QueryCache
key is stored in serialized format or by-reference.true
if the key is stored in serialized
format, false
if the key is stored by-referencepublic QueryCacheConfig setSerializeKeys(boolean serializeKeys)
QueryCache
key is stored in serialized format or by-reference.serializeKeys
- true
if the key is stored in
serialized format, false
if stored by-referenceQueryCacheConfig
instancepublic EvictionConfig getEvictionConfig()
EvictionConfig
instance for this QueryCache
EvictionConfig
instance for this QueryCache
public QueryCacheConfig setEvictionConfig(EvictionConfig evictionConfig)
EvictionConfig
instance for this QueryCache
evictionConfig
- the EvictionConfig
instance for eviction configuration to setQueryCacheConfig
instancepublic QueryCacheConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
EntryListenerConfig
to this QueryCacheConfig
.listenerConfig
- the EntryListenerConfig
to addQueryCacheConfig
instancepublic List<EntryListenerConfig> getEntryListenerConfigs()
public QueryCacheConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)
public QueryCacheConfig addIndexConfig(IndexConfig indexConfig)
public List<IndexConfig> getIndexConfigs()
public QueryCacheConfig setIndexConfigs(List<IndexConfig> indexConfigs)
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public 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.Copyright © 2022 Hazelcast, Inc.. All rights reserved.