Package com.hazelcast.config
Class QueryCacheConfig
java.lang.Object
com.hazelcast.config.QueryCacheConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
Contains configuration for
QueryCache
.- Since:
- 3.5
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
By default, after reaching this minimum size, node immediately sends buffered events toQueryCache
.static final int
By default, only buffer lastDEFAULT_BUFFER_SIZE
events fired from a partition.static final boolean
Default value of coalesce property.static final int
Default value of delay seconds which an event wait in the buffer of a node, before sending toQueryCache
.static final InMemoryFormat
By default, hold values of entries inQueryCache
as binary.static final boolean
By default, also cache values of entries besides keys.static final boolean
By default, execute an initial population query prior to creation of theQueryCache
.static final boolean
Do not serialize given keys by default. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddEntryListenerConfig
(EntryListenerConfig listenerConfig) AddsEntryListenerConfig
to thisQueryCacheConfig
.addIndexConfig
(IndexConfig indexConfig) final boolean
int
After reaching this size, node sends buffered events toQueryCache
.int
Returns the maximum number of events which can be stored in a buffer of partition.int
Returns type identifier for this class.int
Returns the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCache
ReturnsEvictionConfig
instance for thisQueryCache
int
Returns DataSerializableFactory factory ID for this class.Returns memory format of values of entries inQueryCache
.getName()
Returns the name ofQueryCache
.Returns the predicate ofQueryCache
.final int
hashCode()
boolean
Returnstrue
if coalescing is is enabled, otherwise returnsfalse
.boolean
Returnstrue
if value caching enabled, otherwise returnsfalse
.boolean
Returnstrue
if initial population ofQueryCache
is enabled, otherwise returnsfalse
.boolean
Checks if theQueryCache
key is stored in serialized format or by-reference.void
Reads fields from the input streamsetBatchSize
(int batchSize) Sets the batch size which will be used to determine number of events to be sent in a batch toQueryCache
setBufferSize
(int bufferSize) Sets the maximum number of events which can be stored in a buffer of partition.setCoalesce
(boolean coalesce) Settrue
to enable coalescing, otherwise setfalse
.setDelaySeconds
(int delaySeconds) Sets the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCache
setEntryListenerConfigs
(List<EntryListenerConfig> listenerConfigs) setEvictionConfig
(EvictionConfig evictionConfig) Sets theEvictionConfig
instance for thisQueryCache
setIncludeValue
(boolean includeValue) Settrue
to enable value caching, otherwise setfalse
setIndexConfigs
(List<IndexConfig> indexConfigs) setInMemoryFormat
(InMemoryFormat inMemoryFormat) Sets memory format of values of entries inQueryCache
.Sets the name ofQueryCache
.setPopulate
(boolean populate) Settrue
to enable initial population, otherwise setfalse
.setPredicateConfig
(PredicateConfig predicateConfig) Sets the predicate ofQueryCache
.setSerializeKeys
(boolean serializeKeys) Sets if theQueryCache
key is stored in serialized format or by-reference.toString()
void
Writes object fields to output stream
-
Field Details
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZEBy default, after reaching this minimum size, node immediately sends buffered events toQueryCache
.- See Also:
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEBy default, only buffer lastDEFAULT_BUFFER_SIZE
events fired from a partition.- See Also:
-
DEFAULT_DELAY_SECONDS
public static final int DEFAULT_DELAY_SECONDSDefault value of delay seconds which an event wait in the buffer of a node, before sending toQueryCache
.- See Also:
-
DEFAULT_INCLUDE_VALUE
public static final boolean DEFAULT_INCLUDE_VALUEBy default, also cache values of entries besides keys.- See Also:
-
DEFAULT_POPULATE
public static final boolean DEFAULT_POPULATEBy default, execute an initial population query prior to creation of theQueryCache
.- See Also:
-
DEFAULT_COALESCE
public static final boolean DEFAULT_COALESCEDefault value of coalesce property.- See Also:
-
DEFAULT_SERIALIZE_KEYS
public static final boolean DEFAULT_SERIALIZE_KEYSDo not serialize given keys by default.- See Also:
-
DEFAULT_IN_MEMORY_FORMAT
By default, hold values of entries inQueryCache
as binary.
-
-
Constructor Details
-
QueryCacheConfig
public QueryCacheConfig() -
QueryCacheConfig
-
QueryCacheConfig
-
-
Method Details
-
getName
Returns the name ofQueryCache
.- Returns:
- the name of
QueryCache
-
setName
Sets the name ofQueryCache
.- Parameters:
name
- the name ofQueryCache
- Returns:
- this
QueryCacheConfig
instance
-
getPredicateConfig
Returns the predicate ofQueryCache
.- Returns:
- the predicate of
QueryCache
-
setPredicateConfig
Sets the predicate ofQueryCache
.- Parameters:
predicateConfig
- config for predicate- Returns:
- this
QueryCacheConfig
instance
-
getBatchSize
public int getBatchSize()After reaching this size, node sends buffered events toQueryCache
.- Returns:
- the batch size
-
setBatchSize
Sets the batch size which will be used to determine number of events to be sent in a batch toQueryCache
- Parameters:
batchSize
- the batch size- Returns:
- this
QueryCacheConfig
instance
-
getBufferSize
public int getBufferSize()Returns the maximum number of events which can be stored in a buffer of partition.- Returns:
- the maximum number of events which can be stored in a buffer of partition
-
setBufferSize
Sets the maximum number of events which can be stored in a buffer of partition.- Parameters:
bufferSize
- the buffer size- Returns:
- this
QueryCacheConfig
instance
-
getDelaySeconds
public int getDelaySeconds()Returns the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCache
- Returns:
- delay seconds
-
setDelaySeconds
Sets the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCache
- Parameters:
delaySeconds
- the delay seconds- Returns:
- this
QueryCacheConfig
instance
-
getInMemoryFormat
Returns memory format of values of entries inQueryCache
.Default value is binary.
- Returns:
- memory format of values of entries in
QueryCache
-
setInMemoryFormat
Sets memory format of values of entries inQueryCache
.Default value is binary.
- Parameters:
inMemoryFormat
- the memory format- Returns:
- this
QueryCacheConfig
instance
-
isIncludeValue
public boolean isIncludeValue()- Returns:
true
if value caching enabled, otherwise returnsfalse
-
setIncludeValue
- Parameters:
includeValue
- Settrue
if value caching is enabled, otherwise setfalse
- Returns:
- this
QueryCacheConfig
instance
-
isPopulate
public boolean isPopulate()Returnstrue
if initial population ofQueryCache
is enabled, otherwise returnsfalse
.Default value is true.
- Returns:
true
if initial population ofQueryCache
is enabled, otherwise returnsfalse
-
setPopulate
- Parameters:
populate
- settrue
to enable initial population, otherwise setfalse
- Returns:
- this
QueryCacheConfig
instance
-
isCoalesce
public boolean isCoalesce()- Returns:
true
if coalescing is is enabled, otherwise returnsfalse
- See Also:
-
setCoalesce
Settrue
to enable coalescing, otherwise setfalse
. This setting is only valid ifQueryCacheConfig#delaySeconds
is greater than 0.Default value is false.
- Parameters:
coalesce
- settrue
to enable, otherwise setfalse
-
isSerializeKeys
public boolean isSerializeKeys()Checks if theQueryCache
key is stored in serialized format or by-reference.- Returns:
true
if the key is stored in serialized format,false
if the key is stored by-reference
-
setSerializeKeys
Sets if theQueryCache
key is stored in serialized format or by-reference.- Parameters:
serializeKeys
-true
if the key is stored in serialized format,false
if stored by-reference- Returns:
- this
QueryCacheConfig
instance
-
getEvictionConfig
ReturnsEvictionConfig
instance for thisQueryCache
- Returns:
- the
EvictionConfig
instance for thisQueryCache
-
setEvictionConfig
Sets theEvictionConfig
instance for thisQueryCache
- Parameters:
evictionConfig
- theEvictionConfig
instance for eviction configuration to set- Returns:
- this
QueryCacheConfig
instance
-
addEntryListenerConfig
AddsEntryListenerConfig
to thisQueryCacheConfig
.- Parameters:
listenerConfig
- theEntryListenerConfig
to add- Returns:
- this
QueryCacheConfig
instance
-
getEntryListenerConfigs
-
setEntryListenerConfigs
-
addIndexConfig
-
getIndexConfigs
-
setIndexConfigs
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode() -
toString
-