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
FieldsModifier and TypeFieldDescriptionstatic final intBy default, after reaching this minimum size, node immediately sends buffered events toQueryCache.static final intBy default, only buffer lastDEFAULT_BUFFER_SIZEevents fired from a partition.static final booleanDefault value of coalesce property.static final intDefault value of delay seconds which an event wait in the buffer of a node, before sending toQueryCache.static final InMemoryFormatBy default, hold values of entries inQueryCacheas binary.static final booleanBy default, also cache values of entries besides keys.static final booleanBy default, execute an initial population query prior to creation of theQueryCache.static final booleanDo not serialize given keys by default. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEntryListenerConfig(EntryListenerConfig listenerConfig) AddsEntryListenerConfigto thisQueryCacheConfig.addIndexConfig(IndexConfig indexConfig) final booleanintAfter reaching this size, node sends buffered events toQueryCache.intReturns the maximum number of events which can be stored in a buffer of partition.intReturns type identifier for this class.intReturns the minimum number of delay seconds which an event waits in the buffer of node before sending to aQueryCacheReturnsEvictionConfiginstance for thisQueryCacheintReturns DataSerializableFactory factory ID for this class.Returns memory format of values of entries inQueryCache.getName()Returns the name ofQueryCache.Returns the predicate ofQueryCache.final inthashCode()booleanReturnstrueif coalescing is is enabled, otherwise returnsfalse.booleanReturnstrueif value caching enabled, otherwise returnsfalse.booleanReturnstrueif initial population ofQueryCacheis enabled, otherwise returnsfalse.booleanChecks if theQueryCachekey is stored in serialized format or by-reference.voidReads 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 toQueryCachesetBufferSize(int bufferSize) Sets the maximum number of events which can be stored in a buffer of partition.setCoalesce(boolean coalesce) Settrueto 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 aQueryCachesetEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) setEvictionConfig(EvictionConfig evictionConfig) Sets theEvictionConfiginstance for thisQueryCachesetIncludeValue(boolean includeValue) Settrueto enable value caching, otherwise setfalsesetIndexConfigs(List<IndexConfig> indexConfigs) setInMemoryFormat(InMemoryFormat inMemoryFormat) Sets memory format of values of entries inQueryCache.Sets the name ofQueryCache.setPopulate(boolean populate) Settrueto enable initial population, otherwise setfalse.setPredicateConfig(PredicateConfig predicateConfig) Sets the predicate ofQueryCache.setSerializeKeys(boolean serializeKeys) Sets if theQueryCachekey is stored in serialized format or by-reference.toString()voidWrites 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_SIZEevents 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 inQueryCacheas 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
QueryCacheConfiginstance
-
getPredicateConfig
Returns the predicate ofQueryCache.- Returns:
- the predicate of
QueryCache
-
setPredicateConfig
Sets the predicate ofQueryCache.- Parameters:
predicateConfig- config for predicate- Returns:
- this
QueryCacheConfiginstance
-
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
QueryCacheConfiginstance
-
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
QueryCacheConfiginstance
-
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
QueryCacheConfiginstance
-
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
QueryCacheConfiginstance
-
isIncludeValue
public boolean isIncludeValue()- Returns:
trueif value caching enabled, otherwise returnsfalse
-
setIncludeValue
- Parameters:
includeValue- Settrueif value caching is enabled, otherwise setfalse- Returns:
- this
QueryCacheConfiginstance
-
isPopulate
public boolean isPopulate()Returnstrueif initial population ofQueryCacheis enabled, otherwise returnsfalse.Default value is true.
- Returns:
trueif initial population ofQueryCacheis enabled, otherwise returnsfalse
-
setPopulate
- Parameters:
populate- settrueto enable initial population, otherwise setfalse- Returns:
- this
QueryCacheConfiginstance
-
isCoalesce
public boolean isCoalesce()- Returns:
trueif coalescing is is enabled, otherwise returnsfalse- See Also:
-
setCoalesce
Settrueto enable coalescing, otherwise setfalse. This setting is only valid ifQueryCacheConfig#delaySecondsis greater than 0.Default value is false.
- Parameters:
coalesce- settrueto enable, otherwise setfalse
-
isSerializeKeys
public boolean isSerializeKeys()Checks if theQueryCachekey is stored in serialized format or by-reference.- Returns:
trueif the key is stored in serialized format,falseif the key is stored by-reference
-
setSerializeKeys
Sets if theQueryCachekey is stored in serialized format or by-reference.- Parameters:
serializeKeys-trueif the key is stored in serialized format,falseif stored by-reference- Returns:
- this
QueryCacheConfiginstance
-
getEvictionConfig
ReturnsEvictionConfiginstance for thisQueryCache- Returns:
- the
EvictionConfiginstance for thisQueryCache
-
setEvictionConfig
Sets theEvictionConfiginstance for thisQueryCache- Parameters:
evictionConfig- theEvictionConfiginstance for eviction configuration to set- Returns:
- this
QueryCacheConfiginstance
-
addEntryListenerConfig
AddsEntryListenerConfigto thisQueryCacheConfig.- Parameters:
listenerConfig- theEntryListenerConfigto add- Returns:
- this
QueryCacheConfiginstance
-
getEntryListenerConfigs
-
setEntryListenerConfigs
-
addIndexConfig
-
getIndexConfigs
-
setIndexConfigs
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode() -
toString
-