org.apache.ignite.client

## Class ClientCacheConfiguration

- java.lang.Object
- - org.apache.ignite.client.ClientCacheConfiguration

- All Implemented Interfaces:
    Serializable

      public final class ClientCacheConfiguration
      extends Object
      implements Serializable

  Cache configuration.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientCacheConfiguration()` Default constructor.
    `ClientCacheConfiguration(ClientCacheConfiguration ccfg)` Creates client cache configuration by coping all configuration properties from the given one.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CacheAtomicityMode` | `getAtomicityMode()`
    `int` | `getBackups()`
    `CacheMode` | `getCacheMode()`
    `String` | `getDataRegionName()`
    `long` | `getDefaultLockTimeout()` Deprecated. Default lock timeout configuration property has no effect.
    `javax.cache.expiry.ExpiryPolicy` | `getExpiryPolicy()`
    `String` | `getGroupName()` Gets the cache group name.
    `CacheKeyConfiguration[]` | `getKeyConfiguration()`
    `int` | `getMaxConcurrentAsyncOperations()`
    `int` | `getMaxQueryIteratorsCount()`
    `String` | `getName()`
    `PartitionLossPolicy` | `getPartitionLossPolicy()`
    `int` | `getQueryDetailMetricsSize()`
    `QueryEntity[]` | `getQueryEntities()`
    `int` | `getQueryParallelism()`
    `long` | `getRebalanceBatchesPrefetchCount()` Deprecated. Use `IgniteConfiguration.getRebalanceBatchesPrefetchCount()` instead
    `int` | `getRebalanceBatchSize()` Deprecated. Use `IgniteConfiguration.getRebalanceBatchSize()` instead.
    `long` | `getRebalanceDelay()` Deprecated. Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.
    `CacheRebalanceMode` | `getRebalanceMode()` Gets rebalance mode.
    `int` | `getRebalanceOrder()`
    `long` | `getRebalanceThrottle()` Deprecated. Use `IgniteConfiguration.getRebalanceThrottle()` instead.
    `long` | `getRebalanceTimeout()` Deprecated. Use `IgniteConfiguration.getRebalanceTimeout()` instead.
    `int` | `getSqlIndexMaxInlineSize()`
    `String` | `getSqlSchema()`
    `CacheWriteSynchronizationMode` | `getWriteSynchronizationMode()`
    `boolean` | `isCopyOnRead()`
    `boolean` | `isEagerTtl()` Gets flag indicating whether expired cache entries will be eagerly removed from cache.
    `boolean` | `isOnheapCacheEnabled()`
    `boolean` | `isReadFromBackup()`
    `boolean` | `isSqlEscapeAll()`
    `boolean` | `isStatisticsEnabled()`
    `ClientCacheConfiguration` | `setAtomicityMode(CacheAtomicityMode atomicityMode)`
    `ClientCacheConfiguration` | `setBackups(int backups)`
    `ClientCacheConfiguration` | `setCacheMode(CacheMode cacheMode)`
    `ClientCacheConfiguration` | `setCopyOnRead(boolean newVal)`
    `ClientCacheConfiguration` | `setDataRegionName(String newVal)`
    `ClientCacheConfiguration` | `setDefaultLockTimeout(long dfltLockTimeout)` Deprecated. Default lock timeout configuration property has no effect.
    `ClientCacheConfiguration` | `setEagerTtl(boolean eagerTtl)`
    `ClientCacheConfiguration` | `setExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPlc)`
    `ClientCacheConfiguration` | `setGroupName(String newVal)`
    `ClientCacheConfiguration` | `setKeyConfiguration(CacheKeyConfiguration... newVal)`
    `ClientCacheConfiguration` | `setMaxConcurrentAsyncOperations(int newVal)`
    `ClientCacheConfiguration` | `setMaxQueryIteratorsCount(int newVal)`
    `ClientCacheConfiguration` | `setName(String name)`
    `ClientCacheConfiguration` | `setOnheapCacheEnabled(boolean newVal)`
    `ClientCacheConfiguration` | `setPartitionLossPolicy(PartitionLossPolicy newVal)`
    `ClientCacheConfiguration` | `setQueryDetailMetricsSize(int newVal)`
    `ClientCacheConfiguration` | `setQueryEntities(QueryEntity... newVal)`
    `ClientCacheConfiguration` | `setQueryParallelism(int newVal)`
    `ClientCacheConfiguration` | `setReadFromBackup(boolean readFromBackup)`
    `ClientCacheConfiguration` | `setRebalanceBatchesPrefetchCount(long rebalanceBatchesPrefetchCnt)` Deprecated. Use `IgniteConfiguration.getRebalanceBatchesPrefetchCount()` instead
    `ClientCacheConfiguration` | `setRebalanceBatchSize(int rebalanceBatchSize)` Deprecated. Use `IgniteConfiguration.setRebalanceBatchSize(int)` instead.
    `ClientCacheConfiguration` | `setRebalanceDelay(long rebalanceDelay)` Deprecated. Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.
    `ClientCacheConfiguration` | `setRebalanceMode(CacheRebalanceMode rebalanceMode)`
    `ClientCacheConfiguration` | `setRebalanceOrder(int rebalanceOrder)`
    `ClientCacheConfiguration` | `setRebalanceThrottle(long newVal)` Deprecated. Use `IgniteConfiguration.setRebalanceThrottle(long)` instead.
    `ClientCacheConfiguration` | `setRebalanceTimeout(long newVal)` Deprecated. Use `IgniteConfiguration.getRebalanceTimeout()` instead.
    `ClientCacheConfiguration` | `setSqlEscapeAll(boolean newVal)`
    `ClientCacheConfiguration` | `setSqlIndexMaxInlineSize(int newVal)`
    `ClientCacheConfiguration` | `setSqlSchema(String newVal)`
    `ClientCacheConfiguration` | `setStatisticsEnabled(boolean newVal)`
    `ClientCacheConfiguration` | `setWriteSynchronizationMode(CacheWriteSynchronizationMode newVal)`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ClientCacheConfiguration

          public ClientCacheConfiguration()

      Default constructor.

    - #### ClientCacheConfiguration

          public ClientCacheConfiguration(ClientCacheConfiguration ccfg)

      Creates client cache configuration by coping all configuration properties from the given one.
      Parameters:
        `ccfg` - Client cache configuration to copy from.

  - ### Method Detail

    - #### getName

          public String getName()

      Returns:
        Cache name.

    - #### setName

          public ClientCacheConfiguration setName(String name)

      Parameters:
        `name` - New cache name.
      Returns:
        `this` for chaining.

    - #### getAtomicityMode

          public CacheAtomicityMode getAtomicityMode()

      Returns:
        Cache atomicity mode.

    - #### setAtomicityMode

          public ClientCacheConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode)

      Parameters:
        `atomicityMode` - New Atomicity mode.
      Returns:
        `this` for chaining.

    - #### getBackups

          public int getBackups()

      Returns:
        Number of backups.

    - #### setBackups

          public ClientCacheConfiguration setBackups(int backups)

      Parameters:
        `backups` - New number of backups.
      Returns:
        `this` for chaining.

    - #### getCacheMode

          public CacheMode getCacheMode()

      Returns:
        Cache mode.

    - #### setCacheMode

          public ClientCacheConfiguration setCacheMode(CacheMode cacheMode)

      Parameters:
        `cacheMode` - New cache mode.
      Returns:
        `this` for chaining.

    - #### isEagerTtl

          public boolean isEagerTtl()

      Gets flag indicating whether expired cache entries will be eagerly removed from cache. If there is at least one cache configured with this flag set to `true`, Ignite will create a single thread to clean up expired entries in background. When flag is set to `false`, expired entries will be removed on next entry access.
      Returns:
        Flag indicating whether Ignite will eagerly remove expired entries.

    - #### setEagerTtl

          public ClientCacheConfiguration setEagerTtl(boolean eagerTtl)

      Parameters:
        `eagerTtl` - `True` if Ignite should eagerly remove expired cache entries.
      Returns:
        `this` for chaining.

    - #### getGroupName

          public String getGroupName()

      Gets the cache group name.

      Caches with the same group name share single underlying 'physical' cache (partition set), but are logically isolated. Grouping caches reduces overall overhead, since internal data structures are shared.

      Returns:
        `this` for chaining.

    - #### setGroupName

          public ClientCacheConfiguration setGroupName(String newVal)

      Parameters:
        `newVal` - Group name.
      Returns:
        `this` for chaining.

    - #### getDefaultLockTimeout

          @Deprecated
          public long getDefaultLockTimeout()

      Deprecated. Default lock timeout configuration property has no effect.
      Returns:
        Default lock acquisition timeout. `0` and means that lock acquisition will never timeout.

    - #### setDefaultLockTimeout

          @Deprecated
          public ClientCacheConfiguration setDefaultLockTimeout(long dfltLockTimeout)

      Deprecated. Default lock timeout configuration property has no effect.
      Parameters:
        `dfltLockTimeout` - Default lock timeout.
      Returns:
        `this` for chaining.

    - #### getPartitionLossPolicy

          public PartitionLossPolicy getPartitionLossPolicy()

      Returns:
        Partition loss policy. This policy defines how Ignite will react to a situation when all nodes for some partition leave the cluster.

    - #### setPartitionLossPolicy

          public ClientCacheConfiguration setPartitionLossPolicy(PartitionLossPolicy newVal)

      Parameters:
        `newVal` - Partition loss policy.
      Returns:
        `this` for chaining.

    - #### isReadFromBackup

          public boolean isReadFromBackup()

      Returns:
        Flag indicating whether data can be read from backup. If `false` always get data from primary node (never from backup).

    - #### setReadFromBackup

          public ClientCacheConfiguration setReadFromBackup(boolean readFromBackup)

      Parameters:
        `readFromBackup` - Read from backup.
      Returns:
        `this` for chaining.

    - #### getRebalanceBatchSize

          @Deprecated
          public int getRebalanceBatchSize()

      Deprecated. Use `IgniteConfiguration.getRebalanceBatchSize()` instead.
      Returns:
        Size (in number bytes) to be loaded within a single rebalance message. Rebalancing algorithm will split total data set on every node into multiple batches prior to sending data.

    - #### setRebalanceBatchSize

          @Deprecated
          public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize)

      Deprecated. Use `IgniteConfiguration.setRebalanceBatchSize(int)` instead.
      Parameters:
        `rebalanceBatchSize` - Rebalance batch size.
      Returns:
        `this` for chaining.

    - #### getRebalanceBatchesPrefetchCount

          @Deprecated
          public long getRebalanceBatchesPrefetchCount()

      Deprecated. Use `IgniteConfiguration.getRebalanceBatchesPrefetchCount()` instead
      To gain better rebalancing performance supplier node can provide more than one batch at rebalancing start and provide one new to each next demand request.
      Returns:
        Number of batches generated by supply node at rebalancing start. Minimum is 1.

    - #### setRebalanceBatchesPrefetchCount

          @Deprecated
          public ClientCacheConfiguration setRebalanceBatchesPrefetchCount(long rebalanceBatchesPrefetchCnt)

      Deprecated. Use `IgniteConfiguration.getRebalanceBatchesPrefetchCount()` instead
      Parameters:
        `rebalanceBatchesPrefetchCnt` - Rebalance batches prefetch count.
      Returns:
        `this` for chaining.

    - #### getRebalanceDelay

          @Deprecated
          public long getRebalanceDelay()

      Deprecated. Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.
      Returns:
        Delay in milliseconds upon a node joining or leaving topology (or crash) after which rebalancing should be started automatically. Rebalancing should be delayed if you plan to restart nodes after they leave topology, or if you plan to start multiple nodes at once or one after another and don't want to repartition and rebalance until all nodes are started.

        Default value is `0` which means that repartitioning and rebalancing will start immediately upon node leaving topology. If `-1` is returned, then rebalancing will only be started manually.

    - #### setRebalanceDelay

          @Deprecated
          public ClientCacheConfiguration setRebalanceDelay(long rebalanceDelay)

      Deprecated. Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.
      Parameters:
        `rebalanceDelay` - Rebalance delay.
      Returns:
        `this` for chaining.

    - #### getRebalanceMode

          public CacheRebalanceMode getRebalanceMode()

      Gets rebalance mode.
      Returns:
        `this` for chaining.

    - #### setRebalanceMode

          public ClientCacheConfiguration setRebalanceMode(CacheRebalanceMode rebalanceMode)

      Parameters:
        `rebalanceMode` - Rebalance mode.
      Returns:
        `this` for chaining.

    - #### getRebalanceOrder

          public int getRebalanceOrder()

      Returns:
        Cache rebalance order. Rebalance order can be set to non-zero value for caches with `SYNC` or `ASYNC` rebalance modes only.

        If cache rebalance order is positive, rebalancing for this cache will be started only when rebalancing for all caches with smaller rebalance order will be completed.

        Note that cache with order `0` does not participate in ordering. This means that cache with rebalance order `0` will never wait for any other caches. All caches with order `0` will be rebalanced right away concurrently with each other and ordered rebalance processes.

        If not set, cache order is 0, i.e. rebalancing is not ordered.

    - #### setRebalanceOrder

          public ClientCacheConfiguration setRebalanceOrder(int rebalanceOrder)

      Parameters:
        `rebalanceOrder` - Rebalance order.
      Returns:
        `this` for chaining.

    - #### getRebalanceThrottle

          @Deprecated
          public long getRebalanceThrottle()

      Deprecated. Use `IgniteConfiguration.getRebalanceThrottle()` instead.
      Returns:
        Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network. When rebalancing large data sets, the CPU or network can get over-consumed with rebalancing messages, which consecutively may slow down the application performance. This parameter helps tune the amount of time to wait between rebalance messages to make sure that rebalancing process does not have any negative performance impact. Note that application will continue to work properly while rebalancing is still in progress.

        Default value of `0` means that throttling is disabled.

    - #### setRebalanceThrottle

          @Deprecated
          public ClientCacheConfiguration setRebalanceThrottle(long newVal)

      Deprecated. Use `IgniteConfiguration.setRebalanceThrottle(long)` instead.
      Parameters:
        `newVal` - Rebalance throttle.
      Returns:
        `this` for chaining.

    - #### getRebalanceTimeout

          @Deprecated
          public long getRebalanceTimeout()

      Deprecated. Use `IgniteConfiguration.getRebalanceTimeout()` instead.
      Returns:
        Rebalance timeout (ms).

    - #### setRebalanceTimeout

          @Deprecated
          public ClientCacheConfiguration setRebalanceTimeout(long newVal)

      Deprecated. Use `IgniteConfiguration.getRebalanceTimeout()` instead.
      Parameters:
        `newVal` - Rebalance timeout.
      Returns:
        `this` for chaining.

    - #### getWriteSynchronizationMode

          public CacheWriteSynchronizationMode getWriteSynchronizationMode()

      Returns:
        Write synchronization mode. This mode controls whether the main caller should wait for update on other nodes to complete or not.

    - #### setWriteSynchronizationMode

          public ClientCacheConfiguration setWriteSynchronizationMode(CacheWriteSynchronizationMode newVal)

      Parameters:
        `newVal` - Write synchronization mode.
      Returns:
        `this` for chaining.

    - #### isCopyOnRead

          public boolean isCopyOnRead()

      Returns:
        Copy on read.

    - #### setCopyOnRead

          public ClientCacheConfiguration setCopyOnRead(boolean newVal)

      Parameters:
        `newVal` - Copy on read.
      Returns:
        `this` for chaining.

    - #### getMaxConcurrentAsyncOperations

          public int getMaxConcurrentAsyncOperations()

      Returns:
        Max concurrent async operations.

    - #### setMaxConcurrentAsyncOperations

          public ClientCacheConfiguration setMaxConcurrentAsyncOperations(int newVal)

      Parameters:
        `newVal` - Max concurrent async operations.
      Returns:
        `this` for chaining.

    - #### getDataRegionName

          public String getDataRegionName()

      Returns:
        Data region name.

    - #### setDataRegionName

          public ClientCacheConfiguration setDataRegionName(String newVal)

      Parameters:
        `newVal` - Data region name.
      Returns:
        `this` for chaining.

    - #### isStatisticsEnabled

          public boolean isStatisticsEnabled()

      Returns:
        Statistics enabled.

    - #### setStatisticsEnabled

          public ClientCacheConfiguration setStatisticsEnabled(boolean newVal)

      Parameters:
        `newVal` - Statistics enabled.
      Returns:
        `this` for chaining.

    - #### getMaxQueryIteratorsCount

          public int getMaxQueryIteratorsCount()

      Returns:
        Max query iterators count.

    - #### setMaxQueryIteratorsCount

          public ClientCacheConfiguration setMaxQueryIteratorsCount(int newVal)

      Parameters:
        `newVal` - Max query iterators count.
      Returns:
        `this` for chaining.

    - #### isOnheapCacheEnabled

          public boolean isOnheapCacheEnabled()

      Returns:
        Onheap cache enabled.

    - #### setOnheapCacheEnabled

          public ClientCacheConfiguration setOnheapCacheEnabled(boolean newVal)

      Parameters:
        `newVal` - Onheap cache enabled.
      Returns:
        `this` for chaining.

    - #### getQueryDetailMetricsSize

          public int getQueryDetailMetricsSize()

      Returns:
        Query detail metrics size.

    - #### setQueryDetailMetricsSize

          public ClientCacheConfiguration setQueryDetailMetricsSize(int newVal)

      Parameters:
        `newVal` - Query detail metrics size.
      Returns:
        `this` for chaining.

    - #### getQueryParallelism

          public int getQueryParallelism()

      Returns:
        Query parallelism.

    - #### setQueryParallelism

          public ClientCacheConfiguration setQueryParallelism(int newVal)

      Parameters:
        `newVal` - Query parallelism.
      Returns:
        `this` for chaining.

    - #### isSqlEscapeAll

          public boolean isSqlEscapeAll()

      Returns:
        Sql escape all.

    - #### setSqlEscapeAll

          public ClientCacheConfiguration setSqlEscapeAll(boolean newVal)

      Parameters:
        `newVal` - Sql escape all.
      Returns:
        `this` for chaining.

    - #### getSqlIndexMaxInlineSize

          public int getSqlIndexMaxInlineSize()

      Returns:
        Sql index max inline size.

    - #### setSqlIndexMaxInlineSize

          public ClientCacheConfiguration setSqlIndexMaxInlineSize(int newVal)

      Parameters:
        `newVal` - Sql index max inline size.
      Returns:
        `this` for chaining.

    - #### getSqlSchema

          public String getSqlSchema()

      Returns:
        Sql schema.

    - #### setSqlSchema

          public ClientCacheConfiguration setSqlSchema(String newVal)

      Parameters:
        `newVal` - Sql schema.
      Returns:
        `this` for chaining.

    - #### getKeyConfiguration

          public CacheKeyConfiguration[] getKeyConfiguration()

      Returns:
        Cache key configuration.

    - #### setKeyConfiguration

          public ClientCacheConfiguration setKeyConfiguration(CacheKeyConfiguration... newVal)

      Parameters:
        `newVal` - Cache key configuration.
      Returns:
        `this` for chaining.

    - #### getQueryEntities

          public QueryEntity[] getQueryEntities()

      Returns:
        Query entities configurations.

    - #### setQueryEntities

          public ClientCacheConfiguration setQueryEntities(QueryEntity... newVal)

      Parameters:
        `newVal` - Query entities configurations.
      Returns:
        `this` for chaining.

    - #### getExpiryPolicy

          public javax.cache.expiry.ExpiryPolicy getExpiryPolicy()

      Returns:
        Expire policy.

    - #### setExpiryPolicy

          public ClientCacheConfiguration setExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPlc)

      Parameters:
        `expiryPlc` - Expiry policy.
      Returns:
        `this` for chaining.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023