Package com.hazelcast.config
Class QueryCacheConfig
- java.lang.Object
-
- com.hazelcast.config.QueryCacheConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class QueryCacheConfig extends java.lang.Object implements IdentifiedDataSerializable
Contains configuration forQueryCache
.- Since:
- 3.5
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BATCH_SIZE
By default, after reaching this minimum size, node immediately sends buffered events toQueryCache
.static int
DEFAULT_BUFFER_SIZE
By default, only buffer lastDEFAULT_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 toQueryCache
.static InMemoryFormat
DEFAULT_IN_MEMORY_FORMAT
By default, hold values of entries inQueryCache
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 theQueryCache
.static boolean
DEFAULT_SERIALIZE_KEYS
Do not serialize given keys by default.
-
Constructor Summary
Constructors Constructor Description QueryCacheConfig()
QueryCacheConfig(QueryCacheConfig other)
QueryCacheConfig(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryCacheConfig
addEntryListenerConfig(EntryListenerConfig listenerConfig)
AddsEntryListenerConfig
to thisQueryCacheConfig
.QueryCacheConfig
addIndexConfig(IndexConfig indexConfig)
boolean
equals(java.lang.Object o)
int
getBatchSize()
After reaching this size, node sends buffered events toQueryCache
.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 aQueryCache
java.util.List<EntryListenerConfig>
getEntryListenerConfigs()
EvictionConfig
getEvictionConfig()
ReturnsEvictionConfig
instance for thisQueryCache
int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.java.util.List<IndexConfig>
getIndexConfigs()
InMemoryFormat
getInMemoryFormat()
Returns memory format of values of entries inQueryCache
.java.lang.String
getName()
Returns the name ofQueryCache
.PredicateConfig
getPredicateConfig()
Returns the predicate ofQueryCache
.int
hashCode()
boolean
isCoalesce()
Returnstrue
if coalescing is is enabled, otherwise returnsfalse
.boolean
isIncludeValue()
Returnstrue
if value caching enabled, otherwise returnsfalse
.boolean
isPopulate()
Returnstrue
if initial population ofQueryCache
is enabled, otherwise returnsfalse
.boolean
isSerializeKeys()
Checks if theQueryCache
key is stored in serialized format or by-reference.void
readData(ObjectDataInput in)
Reads fields from the input streamQueryCacheConfig
setBatchSize(int batchSize)
Sets the batch size which will be used to determine number of events to be sent in a batch toQueryCache
QueryCacheConfig
setBufferSize(int bufferSize)
Sets the maximum number of events which can be stored in a buffer of partition.QueryCacheConfig
setCoalesce(boolean coalesce)
Settrue
to enable coalescing, otherwise setfalse
.QueryCacheConfig
setDelaySeconds(int delaySeconds)
Sets the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCache
QueryCacheConfig
setEntryListenerConfigs(java.util.List<EntryListenerConfig> listenerConfigs)
QueryCacheConfig
setEvictionConfig(EvictionConfig evictionConfig)
Sets theEvictionConfig
instance for thisQueryCache
QueryCacheConfig
setIncludeValue(boolean includeValue)
Settrue
to enable value caching, otherwise setfalse
QueryCacheConfig
setIndexConfigs(java.util.List<IndexConfig> indexConfigs)
QueryCacheConfig
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Sets memory format of values of entries inQueryCache
.QueryCacheConfig
setName(java.lang.String name)
Sets the name ofQueryCache
.QueryCacheConfig
setPopulate(boolean populate)
Settrue
to enable initial population, otherwise setfalse
.QueryCacheConfig
setPredicateConfig(PredicateConfig predicateConfig)
Sets the predicate ofQueryCache
.QueryCacheConfig
setSerializeKeys(boolean serializeKeys)
Sets if theQueryCache
key is stored in serialized format or by-reference.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Field Detail
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
By default, after reaching this minimum size, node immediately sends buffered events toQueryCache
.- See Also:
- Constant Field Values
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
By default, only buffer lastDEFAULT_BUFFER_SIZE
events fired from a partition.- See Also:
- Constant Field Values
-
DEFAULT_DELAY_SECONDS
public static final int DEFAULT_DELAY_SECONDS
Default value of delay seconds which an event wait in the buffer of a node, before sending toQueryCache
.- See Also:
- Constant Field Values
-
DEFAULT_INCLUDE_VALUE
public static final boolean DEFAULT_INCLUDE_VALUE
By default, also cache values of entries besides keys.- See Also:
- Constant Field Values
-
DEFAULT_POPULATE
public static final boolean DEFAULT_POPULATE
By default, execute an initial population query prior to creation of theQueryCache
.- See Also:
- Constant Field Values
-
DEFAULT_COALESCE
public static final boolean DEFAULT_COALESCE
Default value of coalesce property.- See Also:
- Constant Field Values
-
DEFAULT_SERIALIZE_KEYS
public static final boolean DEFAULT_SERIALIZE_KEYS
Do not serialize given keys by default.- See Also:
- Constant Field Values
-
DEFAULT_IN_MEMORY_FORMAT
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
By default, hold values of entries inQueryCache
as binary.
-
-
Constructor Detail
-
QueryCacheConfig
public QueryCacheConfig()
-
QueryCacheConfig
public QueryCacheConfig(java.lang.String name)
-
QueryCacheConfig
public QueryCacheConfig(QueryCacheConfig other)
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name ofQueryCache
.- Returns:
- the name of
QueryCache
-
setName
public QueryCacheConfig setName(java.lang.String name)
Sets the name ofQueryCache
.- Parameters:
name
- the name ofQueryCache
- Returns:
- this
QueryCacheConfig
instance
-
getPredicateConfig
public PredicateConfig getPredicateConfig()
Returns the predicate ofQueryCache
.- Returns:
- the predicate of
QueryCache
-
setPredicateConfig
public QueryCacheConfig setPredicateConfig(PredicateConfig predicateConfig)
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
public QueryCacheConfig setBatchSize(int batchSize)
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
public QueryCacheConfig setBufferSize(int bufferSize)
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
public QueryCacheConfig setDelaySeconds(int delaySeconds)
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
public InMemoryFormat getInMemoryFormat()
Returns memory format of values of entries inQueryCache
.Default value is binary.
- Returns:
- memory format of values of entries in
QueryCache
-
setInMemoryFormat
public QueryCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
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
public QueryCacheConfig setIncludeValue(boolean includeValue)
- 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
public QueryCacheConfig setPopulate(boolean populate)
- 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(boolean)
-
setCoalesce
public QueryCacheConfig setCoalesce(boolean coalesce)
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
public QueryCacheConfig setSerializeKeys(boolean serializeKeys)
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
public EvictionConfig getEvictionConfig()
ReturnsEvictionConfig
instance for thisQueryCache
- Returns:
- the
EvictionConfig
instance for thisQueryCache
-
setEvictionConfig
public QueryCacheConfig setEvictionConfig(EvictionConfig evictionConfig)
Sets theEvictionConfig
instance for thisQueryCache
- Parameters:
evictionConfig
- theEvictionConfig
instance for eviction configuration to set- Returns:
- this
QueryCacheConfig
instance
-
addEntryListenerConfig
public QueryCacheConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
AddsEntryListenerConfig
to thisQueryCacheConfig
.- Parameters:
listenerConfig
- theEntryListenerConfig
to add- Returns:
- this
QueryCacheConfig
instance
-
getEntryListenerConfigs
public java.util.List<EntryListenerConfig> getEntryListenerConfigs()
-
setEntryListenerConfigs
public QueryCacheConfig setEntryListenerConfigs(java.util.List<EntryListenerConfig> listenerConfigs)
-
addIndexConfig
public QueryCacheConfig addIndexConfig(IndexConfig indexConfig)
-
getIndexConfigs
public java.util.List<IndexConfig> getIndexConfigs()
-
setIndexConfigs
public QueryCacheConfig setIndexConfigs(java.util.List<IndexConfig> indexConfigs)
-
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
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-