com.hazelcast.config

## Class QueryCacheConfig

- java.lang.Object
- - com.hazelcast.config.QueryCacheConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class QueryCacheConfig
      extends Object
      implements IdentifiedDataSerializable

  Contains configuration for `QueryCache`.
  Since:
    3.5

- - ### Field Summary

    Fields
    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`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryCacheConfig()`
    `QueryCacheConfig(QueryCacheConfig other)`
    `QueryCacheConfig(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `QueryCacheConfig` | `addEntryListenerConfig(EntryListenerConfig listenerConfig)` Adds `EntryListenerConfig` to this `QueryCacheConfig`.
    `QueryCacheConfig` | `addIndexConfig(MapIndexConfig mapIndexConfig)`
    `boolean` | `equals(Object o)`
    `com.hazelcast.config.QueryCacheConfigReadOnly` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `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` | `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.
    `int` | `getId()` Returns type identifier for this class.
    `List<MapIndexConfig>` | `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`.
    `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<MapIndexConfig> 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`.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_BATCH_SIZE

          public static final int DEFAULT_BATCH_SIZE

      By default, after reaching this minimum size, node immediately sends buffered events to `QueryCache`.
      See Also:
        Constant Field Values

    - #### DEFAULT_BUFFER_SIZE

          public static final int DEFAULT_BUFFER_SIZE

      By default, only buffer last `DEFAULT_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 to `QueryCache`.
      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 the `QueryCache`.
      See Also:
        Constant Field Values

    - #### DEFAULT_COALESCE

          public static final boolean DEFAULT_COALESCE

      Default value of coalesce property.
      See Also:
        Constant Field Values

    - #### DEFAULT_IN_MEMORY_FORMAT

          public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT

      By default, hold values of entries in `QueryCache` as binary.

  - ### Constructor Detail

    - #### QueryCacheConfig

          public QueryCacheConfig()

    - #### QueryCacheConfig

          public QueryCacheConfig(String name)

    - #### QueryCacheConfig

          public QueryCacheConfig(QueryCacheConfig other)

  - ### Method Detail

    - #### getAsReadOnly

          public com.hazelcast.config.QueryCacheConfigReadOnly getAsReadOnly()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this configuration

    - #### getName

          public String getName()

      Returns the name of `QueryCache`.
      Returns:
        the name of `QueryCache`

    - #### setName

          public QueryCacheConfig setName(String name)

      Sets the name of `QueryCache`.
      Parameters:
        `name` - the name of `QueryCache`
      Returns:
        this `QueryCacheConfig` instance

    - #### getPredicateConfig

          public PredicateConfig getPredicateConfig()

      Returns the predicate of `QueryCache`.
      Returns:
        the predicate of `QueryCache`

    - #### setPredicateConfig

          public QueryCacheConfig setPredicateConfig(PredicateConfig predicateConfig)

      Sets the predicate of `QueryCache`.
      Parameters:
        `predicateConfig` - config for predicate
      Returns:
        this `QueryCacheConfig` instance

    - #### getBatchSize

          public int getBatchSize()

      After reaching this size, node sends buffered events to `QueryCache`.
      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 to `QueryCache`
      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 a `QueryCache`
      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 a `QueryCache`
      Parameters:
        `delaySeconds` - the delay seconds
      Returns:
        this `QueryCacheConfig` instance

    - #### getInMemoryFormat

          public InMemoryFormat getInMemoryFormat()

      Returns memory format of values of entries in `QueryCache`.

      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 in `QueryCache`.

      Default value is binary.

      Parameters:
        `inMemoryFormat` - the memory format
      Returns:
        this `QueryCacheConfig` instance

    - #### isIncludeValue

          public boolean isIncludeValue()

      Returns `true` if value caching enabled, otherwise returns `false`.

      Default value is true.

      Returns:
        `true` if value caching enabled, otherwise returns `false`

    - #### setIncludeValue

          public QueryCacheConfig setIncludeValue(boolean includeValue)

      Set `true` to enable value caching, otherwise set `false`

      Default value is true.

      Parameters:
        `includeValue` - Set `true` if value caching is enabled, otherwise set `false`
      Returns:
        this `QueryCacheConfig` instance

    - #### isPopulate

          public boolean isPopulate()

      Returns `true` if initial population of `QueryCache` is enabled, otherwise returns `false`.

      Default value is true.

      Returns:
        `true` if initial population of `QueryCache` is enabled, otherwise returns `false`

    - #### setPopulate

          public QueryCacheConfig setPopulate(boolean populate)

      Set `true` to enable initial population, otherwise set `false`.

      Default value is true.

      Parameters:
        `populate` - set `true` to enable initial population, otherwise set `false`
      Returns:
        this `QueryCacheConfig` instance

    - #### isCoalesce

          public boolean isCoalesce()

      Returns `true` if coalescing is is enabled, otherwise returns `false`.

      Default value is false.

      Returns:
        `true` if coalescing is is enabled, otherwise returns `false`
      See Also:
        `setCoalesce(boolean)`

    - #### setCoalesce

          public QueryCacheConfig setCoalesce(boolean coalesce)

      Set `true` to enable coalescing, otherwise set `false`. This setting is only valid if `QueryCacheConfig#delaySeconds` is greater than 0.

      Default value is false.

      Parameters:
        `coalesce` - set `true` to enable, otherwise set `false`

    - #### getEvictionConfig

          public EvictionConfig getEvictionConfig()

      Returns `EvictionConfig` instance for this `QueryCache`
      Returns:
        the `EvictionConfig` instance for this `QueryCache`

    - #### setEvictionConfig

          public QueryCacheConfig setEvictionConfig(EvictionConfig evictionConfig)

      Sets the `EvictionConfig` instance for this `QueryCache`
      Parameters:
        `evictionConfig` - the `EvictionConfig` instance for eviction configuration to set
      Returns:
        this `QueryCacheConfig` instance

    - #### addEntryListenerConfig

          public QueryCacheConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)

      Adds `EntryListenerConfig` to this `QueryCacheConfig`.
      Parameters:
        `listenerConfig` - the `EntryListenerConfig` to add
      Returns:
        this `QueryCacheConfig` instance

    - #### getEntryListenerConfigs

          public List<EntryListenerConfig> getEntryListenerConfigs()

    - #### setEntryListenerConfigs

          public QueryCacheConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)

    - #### addIndexConfig

          public QueryCacheConfig addIndexConfig(MapIndexConfig mapIndexConfig)

    - #### getIndexConfigs

          public List<MapIndexConfig> getIndexConfigs()

    - #### setIndexConfigs

          public QueryCacheConfig setIndexConfigs(List<MapIndexConfig> indexConfigs)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2020. All rights reserved.