org.apache.ignite.configuration

## Class CollectionConfiguration

- java.lang.Object
- - org.apache.ignite.configuration.CollectionConfiguration

- All Implemented Interfaces:
    Serializable

      public class CollectionConfiguration
      extends Object
      implements Serializable

  Configuration for Ignite collections.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectionConfiguration()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CacheAtomicityMode` | `getAtomicityMode()`
    `int` | `getBackups()`
    `CacheMode` | `getCacheMode()`
    `String` | `getGroupName()`
    `IgnitePredicate<ClusterNode>` | `getNodeFilter()`
    `long` | `getOffHeapMaxMemory()` Deprecated. No longer used.
    `boolean` | `isCollocated()`
    `CollectionConfiguration` | `setAtomicityMode(CacheAtomicityMode atomicityMode)`
    `CollectionConfiguration` | `setBackups(int backups)`
    `CollectionConfiguration` | `setCacheMode(CacheMode cacheMode)`
    `CollectionConfiguration` | `setCollocated(boolean collocated)`
    `CollectionConfiguration` | `setGroupName(String grpName)`
    `CollectionConfiguration` | `setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter)`
    `CollectionConfiguration` | `setOffHeapMaxMemory(long offHeapMaxMemory)` Deprecated. No longer used.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### CollectionConfiguration

          public CollectionConfiguration()

  - ### Method Detail

    - #### isCollocated

          public boolean isCollocated()

      Returns:
        `True` if all items within the same collection will be collocated on the same node.

    - #### setCollocated

          public CollectionConfiguration setCollocated(boolean collocated)

      Parameters:
        `collocated` - If `true` then all items within the same collection will be collocated on the same node. Otherwise elements of the same set maybe be cached on different nodes. This parameter works only collections stored in `CacheMode.PARTITIONED` cache.
      Returns:
        `this` for chaining.

    - #### getAtomicityMode

          public CacheAtomicityMode getAtomicityMode()

      Returns:
        Cache atomicity mode.

    - #### setAtomicityMode

          public CollectionConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode)

      Parameters:
        `atomicityMode` - Cache atomicity mode.
      Returns:
        `this` for chaining.

    - #### getCacheMode

          public CacheMode getCacheMode()

      Returns:
        Cache mode.

    - #### setCacheMode

          public CollectionConfiguration setCacheMode(CacheMode cacheMode)

      Parameters:
        `cacheMode` - Cache mode.
      Returns:
        `this` for chaining.

    - #### getNodeFilter

          public IgnitePredicate<ClusterNode> getNodeFilter()

      Returns:
        Predicate specifying on which nodes the cache should be started.

    - #### setNodeFilter

          public CollectionConfiguration setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter)

      Parameters:
        `nodeFilter` - Predicate specifying on which nodes the cache should be started.
      Returns:
        `this` for chaining.

    - #### getBackups

          public int getBackups()

      Returns:
        Number of backups.

    - #### setBackups

          public CollectionConfiguration setBackups(int backups)

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

    - #### getOffHeapMaxMemory

          @Deprecated
          public long getOffHeapMaxMemory()

      Deprecated. No longer used.
      Returns:
        Off-heap memory size.

    - #### setOffHeapMaxMemory

          @Deprecated
          public CollectionConfiguration setOffHeapMaxMemory(long offHeapMaxMemory)

      Deprecated. No longer used.
      Parameters:
        `offHeapMaxMemory` - Off-heap memory size.
      Returns:
        `this` for chaining.

    - #### getGroupName

          public String getGroupName()

      Returns:
        Group name.

    - #### setGroupName

          public CollectionConfiguration setGroupName(String grpName)

      Parameters:
        `grpName` - Group name.
      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