RegionAttributes (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache, interface: RegionAttributes

Package org.apache.geode.cache

# Interface RegionAttributes<K,V>

public interface RegionAttributes<K,V>
Defines attributes for configuring a region. These are `EvictionAttributes`, `CacheListener`, `CacheLoader`, `CacheWriter`, scope, data policy, and expiration attributes for the region itself, expiration attributes for the region entries, and whether statistics are enabled for the region and its entries. To create an instance of this interface use `AttributesFactory.createRegionAttributes()`. For compatibility rules and default values, see `AttributesFactory`.

Note that the `RegionAttributes` are not distributed with the region.

Since:
  GemFire 2.0
See Also:
  - `AttributesFactory`
  - `AttributesMutator`
  - `Region.getAttributes()`
  - `EvictionAttributes`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<String>`
  `getAsyncEventQueueIds()`
  Returns a set of AsyncEventQueueIds added to the region
  `CacheListener<K,V>`
  `getCacheListener()`
  Deprecated.
  as of GemFire 5.0, use `getCacheListeners()` instead
  `CacheListener<K,V>[]`
  `getCacheListeners()`
  Returns an array of all the cache listeners on this attributes.
  `CacheLoader<K,V>`
  `getCacheLoader()`
  Returns the cache loader associated with this region.
  `CacheWriter<K,V>`
  `getCacheWriter()`
  Returns the cache writer associated with this region.
  `boolean`
  `getCloningEnabled()`
  Returns whether or not cloning is enabled on region.
  `Compressor`
  `getCompressor()`
  Returns the compressor used by this region's entry values.
  `boolean`
  `getConcurrencyChecksEnabled()`
  Returns true if concurrent update checks are turned on for this region.
  `int`
  `getConcurrencyLevel()`
  Returns the concurrencyLevel of the entries map.
  `CustomExpiry<K,V>`
  `getCustomEntryIdleTimeout()`
  Gets the `idleTimeout` `CustomExpiry`, if any for entries in this region
  `CustomExpiry<K,V>`
  `getCustomEntryTimeToLive()`
  Gets the `entryTimeToLive` `CustomExpiry`, if any for entries in this region
  `DataPolicy`
  `getDataPolicy()`
  Returns the data policy for this region.
  `File[]`
  `getDiskDirs()`
  Deprecated.
  as of 6.5 use `DiskStore.getDiskDirs()` instead.
  `int[]`
  `getDiskDirSizes()`
  Deprecated.
  as of 6.5 use `DiskStore.getDiskDirSizes()` instead.
  `String`
  `getDiskStoreName()`
  Returns the name of the `DiskStore` that this region belongs to, if any.
  `DiskWriteAttributes`
  `getDiskWriteAttributes()`
  Deprecated.
  as of 6.5 use `getDiskStoreName()` instead.
  `boolean`
  `getEarlyAck()`
  Deprecated.
  Setting early ack no longer has any effect.
  `boolean`
  `getEnableAsyncConflation()`
  Returns whether or not async conflation is enabled for sending messages to async peers.
  `boolean`
  `getEnableBridgeConflation()`
  Deprecated.
  as of GemFire 5.0, use `getEnableSubscriptionConflation()` instead
  `boolean`
  `getEnableConflation()`
  Deprecated.
  as of GemFire 5.0, use `getEnableSubscriptionConflation()` instead #
  `boolean`
  `getEnableSubscriptionConflation()`
  Returns whether or not conflation is enabled for sending messages from a cache server to its clients.
  `ExpirationAttributes`
  `getEntryIdleTimeout()`
  Gets the `idleTimeout` expiration attributes for entries in this region.
  `ExpirationAttributes`
  `getEntryTimeToLive()`
  Gets the `timeToLive` expiration attributes for entries in this region.
  `EvictionAttributes`
  `getEvictionAttributes()`
  Attributes that control the size of the `Region` using an `EvictionAlgorithm` and a `EvictionAction`.
  `Set<String>`
  `getGatewaySenderIds()`
  Returns a set of gatewaysenderIds
  `boolean`
  `getIgnoreJTA()`
  Gets the flag telling a region to ignore JTA transactions.
  `boolean`
  `getIndexMaintenanceSynchronous()`
  Returns the value of `IndexMaintenanceSynchronous` which specifies whether the region indexes are updated synchronously when a region is modified or asynchronously in a background thread.
  `int`
  `getInitialCapacity()`
  Returns the initial capacity of the entries map.
  `Class<K>`
  `getKeyConstraint()`
  Returns the class that the keys in this region are constrained to.
  `float`
  `getLoadFactor()`
  Returns the load factor of the entries map.
  `MembershipAttributes`
  `getMembershipAttributes()`
  Deprecated.
  this API is scheduled to be removed
  `MirrorType`
  `getMirrorType()`
  Deprecated.
  as of GemFire 5.0, use `getDataPolicy()` instead.
  `boolean`
  `getMulticastEnabled()`
  Returns true if multicast communications are enabled for this region.
  `boolean`
  `getOffHeap()`
  Returns whether or not this region uses off-heap memory.
  `PartitionAttributes`
  `getPartitionAttributes()`
  Returns the `PartitionAttributes` that configure how the region is partitioned.
  `boolean`
  `getPersistBackup()`
  Deprecated.
  as of GemFire 5.0, use `DataPolicy.PERSISTENT_REPLICATE` instead
  `String`
  `getPoolName()`
  Returns the name of the `Pool` that this region will use to communicate with servers, if any.
  `boolean`
  `getPublisher()`
  Deprecated.
  as of 6.5
  `ExpirationAttributes`
  `getRegionIdleTimeout()`
  Gets the idleTimeout expiration attributes for the region as a whole.
  `ExpirationAttributes`
  `getRegionTimeToLive()`
  Gets the `timeToLive` expiration attributes for the region as a whole.
  `Scope`
  `getScope()`
  Returns the scope of the region.
  `boolean`
  `getStatisticsEnabled()`
  Returns whether the statistics are enabled for this region and its entries.
  `SubscriptionAttributes`
  `getSubscriptionAttributes()`
  Returns the `SubscriptionAttributes` that configure how this region behaves as a subscriber to remote caches.
  `Class<V>`
  `getValueConstraint()`
  Returns the class that the values in this region are constrained to.
  `boolean`
  `isDiskSynchronous()`
  Returns true if configured synchronous disk writes.
  `boolean`
  `isLockGrantor()`
  Returns true if this member is configured to be lock grantor for the region.

- ## Method Details

  - ### getCacheLoader

    CacheLoader<K,V> getCacheLoader()
    Returns the cache loader associated with this region.
    Returns:
      the cache loader

  - ### getCacheWriter

    CacheWriter<K,V> getCacheWriter()
    Returns the cache writer associated with this region.
    Returns:
      the cache writer

  - ### getKeyConstraint

    Class<K> getKeyConstraint()
    Returns the class that the keys in this region are constrained to.
    Returns:
      the `Class` the keys must be an `instanceof`

  - ### getValueConstraint

    Class<V> getValueConstraint()
    Returns the class that the values in this region are constrained to.
    Returns:
      the `Class` the values must be an `instanceof`

  - ### getRegionTimeToLive

    ExpirationAttributes getRegionTimeToLive()
    Gets the `timeToLive` expiration attributes for the region as a whole. Default is 0 which indicates that no expiration of this type will happen.
    Returns:
      the timeToLive expiration attributes for this region

  - ### getRegionIdleTimeout

    ExpirationAttributes getRegionIdleTimeout()
    Gets the idleTimeout expiration attributes for the region as a whole. Default is 0 which indicates that no expiration of this type will happen. Note that the XML element that corresponds to this method "region-idle-time", does not include "out" in its name.
    Returns:
      the IdleTimeout expiration attributes for this region

  - ### getEntryTimeToLive

    ExpirationAttributes getEntryTimeToLive()
    Gets the `timeToLive` expiration attributes for entries in this region. Default is 0 which indicates that no expiration of this type is set.
    Returns:
      the timeToLive expiration attributes for entries in this region

  - ### getEntryIdleTimeout

    ExpirationAttributes getEntryIdleTimeout()
    Gets the `idleTimeout` expiration attributes for entries in this region. Default is 0 which indicates that no expiration of this type is set. Note that the XML element that corresponds to this method "entry-idle-time", does not include "out" in its name.
    Returns:
      the idleTimeout expiration attributes for entries in this region

  - ### getCustomEntryTimeToLive

    CustomExpiry<K,V> getCustomEntryTimeToLive()
    Gets the `entryTimeToLive` `CustomExpiry`, if any for entries in this region
    Returns:
      the entryTimeToLive CustomExpiry for entries in this region

  - ### getCustomEntryIdleTimeout

    CustomExpiry<K,V> getCustomEntryIdleTimeout()
    Gets the `idleTimeout` `CustomExpiry`, if any for entries in this region
    Returns:
      the idleTimeout CustomExpiry for entries in this region

  - ### getIgnoreJTA

    boolean getIgnoreJTA()
    Gets the flag telling a region to ignore JTA transactions. Default value is set to false.
    Returns:
      the flag telling a region to ignore JTA transactions
    Since:
      GemFire 5.0

  - ### getMirrorType

    @Deprecated MirrorType getMirrorType()
    Deprecated.
    as of GemFire 5.0, use `getDataPolicy()` instead.
    Returns the type of mirroring for this region.
    Returns:
      the region's `MirrorType`

  - ### getDataPolicy

    DataPolicy getDataPolicy()
    Returns the data policy for this region. Default value of DataPolicy is set to 'Normal'. Please refer the gemfire documentation for more details on this.
    Returns:
      the region's `DataPolicy`
    Since:
      GemFire 5.0

  - ### getScope

    Scope getScope()
    Returns the scope of the region. Default scope is DISTRIBUTED_NO_ACK. Please refer the gemfire documentation for more details on this.
    Returns:
      the region's `Scope`

  - ### getEvictionAttributes

    EvictionAttributes getEvictionAttributes()
    Attributes that control the size of the `Region` using an `EvictionAlgorithm` and a `EvictionAction`.
    Returns:
      the region's EvictionAttributes

  - ### getCacheListener

    @Deprecated CacheListener<K,V> getCacheListener()
    Deprecated.
    as of GemFire 5.0, use `getCacheListeners()` instead
    Returns the cache listener for the region.
    Returns:
      the region's `CacheListener`
    Throws:
      `IllegalStateException` - if more than one cache listener exists on this attributes

  - ### getCacheListeners

    CacheListener<K,V>[] getCacheListeners()
    Returns an array of all the cache listeners on this attributes. Modifications to the returned array will not effect the attributes.
    Returns:
      the region's `CacheListener`s; an empty array if no listeners
    Since:
      GemFire 5.0

  - ### getInitialCapacity

    int getInitialCapacity()
    Returns the initial capacity of the entries map. Default is 16.
    Returns:
      the initial capacity of the entries map
    See Also:
      - `HashMap`

  - ### getLoadFactor

    float getLoadFactor()
    Returns the load factor of the entries map. Default is 0.75.
    Returns:
      the load factor of the entries map
    See Also:
      - `HashMap`

  - ### isLockGrantor

    boolean isLockGrantor()
    Returns true if this member is configured to be lock grantor for the region. Result will always be false if the scope is not `Scope.GLOBAL`.

    This attribute does not indicate whether or not this member is currently lock grantor. It only indicates that at the time of region creation, this member should attempt to become lock grantor. Default value is false.

    Returns:
      true if this member is configured to be lock grantor for the region
    See Also:
      - `AttributesFactory`
      - `Region.becomeLockGrantor()`

  - ### getMulticastEnabled

    boolean getMulticastEnabled()
    Returns true if multicast communications are enabled for this region. Multicast must also be enabled in the DistributedSystem. Default value is set to false.
    Returns:
      true if this region is configured to allow use of multicast for distributed messaging
    Since:
      GemFire 5.0
    See Also:
      - `AttributesFactory.setMulticastEnabled(boolean)`

  - ### getConcurrencyLevel

    int getConcurrencyLevel()
    Returns the concurrencyLevel of the entries map. Default is 16.
    Returns:
      the concurrencyLevel
    See Also:
      - `AttributesFactory`

  - ### getPersistBackup

    @Deprecated boolean getPersistBackup()
    Deprecated.
    as of GemFire 5.0, use `DataPolicy.PERSISTENT_REPLICATE` instead
    Returns whether or not a persistent backup should be made of the region (as opposed to just writing the overflow data to disk).
    Returns:
      whether a persistent backup should be made of the region
    Since:
      GemFire 3.2

  - ### getDiskWriteAttributes

    @Deprecated DiskWriteAttributes getDiskWriteAttributes()
    Deprecated.
    as of 6.5 use `getDiskStoreName()` instead.
    Returns the `DiskWriteAttributes` that configure how the region is written to disk.
    Returns:
      the `DiskWriteAttributes` that configure how the region is written to disk
    Since:
      GemFire 3.2

  - ### getDiskDirs

    @Deprecated File[] getDiskDirs()
    Deprecated.
    as of 6.5 use `DiskStore.getDiskDirs()` instead.
    Returns the directories to which the region's data are written. If multiple directories are used, GemFire will attempt to distribute the data evenly amongst them.
    Returns:
      the directories to which the region's data are written
    Since:
      GemFire 3.2

  - ### getIndexMaintenanceSynchronous

    boolean getIndexMaintenanceSynchronous()
    Returns the value of `IndexMaintenanceSynchronous` which specifies whether the region indexes are updated synchronously when a region is modified or asynchronously in a background thread. Default value is true.
    Returns:
      the value of `IndexMaintenanceSynchronous`
    Since:
      GemFire 4.0

  - ### getPartitionAttributes

    PartitionAttributes getPartitionAttributes()
    Returns the `PartitionAttributes` that configure how the region is partitioned.
    Returns:
      the `PartitionAttributes` that configure how the region is partitioned
    Since:
      GemFire 5.0

  - ### getMembershipAttributes

    @Deprecated MembershipAttributes getMembershipAttributes()
    Deprecated.
    this API is scheduled to be removed
    Returns the `MembershipAttributes` that configure required roles for reliable access to the region.
    Returns:
      the `MembershipAttributes` that configure required roles for reliable access to the region

  - ### getSubscriptionAttributes

    SubscriptionAttributes getSubscriptionAttributes()
    Returns the `SubscriptionAttributes` that configure how this region behaves as a subscriber to remote caches.
    Returns:
      the `SubscriptionAttributes` that configure how this region behaves as a subscriber to remote caches
    Since:
      GemFire 5.0

  - ### getStatisticsEnabled

    boolean getStatisticsEnabled()
    Returns whether the statistics are enabled for this region and its entries. Default is false.
    Returns:
      true if statistics are enabled

  - ### getEarlyAck

    @Deprecated boolean getEarlyAck()
    Deprecated.
    Setting early ack no longer has any effect.
    Returns whether or not acks are sent after an update is processed.
    Returns:
      True if acks are sent after updates are processed; false if acks are sent before updates are processed.
    Since:
      GemFire 4.1

  - ### getPublisher

    @Deprecated boolean getPublisher()
    Deprecated.
    as of 6.5
    Returns whether or not this region is a publisher. Publishers are regions on which distributed write operations are done.
    Returns:
      True if a publisher; false if not (default).
    Since:
      GemFire 4.2.3

  - ### getEnableConflation

    @Deprecated boolean getEnableConflation()
    Deprecated.
    as of GemFire 5.0, use `getEnableSubscriptionConflation()` instead #
    Returns whether or not conflation is enabled for sending messages from a cache server to its clients. Note: This parameter is only valid for cache server to client communication. It has no effect in peer to peer communication.
    Returns:
      True if conflation is enabled; false conflation is not enabled (default).
    Since:
      GemFire 4.2

  - ### getEnableBridgeConflation

    @Deprecated boolean getEnableBridgeConflation()
    Deprecated.
    as of GemFire 5.0, use `getEnableSubscriptionConflation()` instead
    Returns whether or not conflation is enabled for sending messages from a cache server to its clients. Note: This parameter is only valid for cache server to client communication. It has no effect in peer to peer communication.
    Returns:
      True if conflation is enabled; false conflation is not enabled (default).
    Since:
      GemFire 5.0

  - ### getEnableSubscriptionConflation

    boolean getEnableSubscriptionConflation()
    Returns whether or not conflation is enabled for sending messages from a cache server to its clients. Note: This parameter is only valid for cache server to client communication. It has no effect in peer to peer communication. Default is false.
    Returns:
      True if conflation is enabled; false conflation is not enabled (default).
    Since:
      GemFire 5.7

  - ### getEnableAsyncConflation

    boolean getEnableAsyncConflation()
    Returns whether or not async conflation is enabled for sending messages to async peers. Default is false.
    Returns:
      True if async conflation is enabled; false async conflation is not enabled (default).
    Since:
      GemFire 4.2.3

  - ### getDiskDirSizes

    @Deprecated int[] getDiskDirSizes()
    Deprecated.
    as of 6.5 use `DiskStore.getDiskDirSizes()` instead.
    Returns the sizes of the disk directories in megabytes
    Returns:
      int[] sizes of the disk directories

  - ### getPoolName

    String getPoolName()
    Returns the name of the `Pool` that this region will use to communicate with servers, if any. Returns `null` if this region communicates with peers.
    Returns:
      the name of the client-server `Pool` this region will use for server communication; `null` is returned if the region communicates with peers.
    Since:
      GemFire 5.7

  - ### getCloningEnabled

    boolean getCloningEnabled()
    Returns whether or not cloning is enabled on region. Default is false.
    Returns:
      True if cloning is enabled; false cloning is not enabled (default).
    Since:
      GemFire 6.1

  - ### getDiskStoreName

    String getDiskStoreName()
    Returns the name of the `DiskStore` that this region belongs to, if any. Returns `null` if this region belongs to default `DiskStore`.
    Returns:
      the name of the `DiskStore` of this region; `null` is returned if this region belongs to default `DiskStore`.
    Since:
      GemFire 6.5

  - ### isDiskSynchronous

    boolean isDiskSynchronous()
    Returns true if configured synchronous disk writes. Default is set to true.
    Returns:
      Returns true if writes to disk are synchronous and false otherwise
    Since:
      GemFire 6.5

  - ### getGatewaySenderIds

    Set<String> getGatewaySenderIds()
    Returns a set of gatewaysenderIds
    Returns:
      a set of gatewaysenderIds

  - ### getAsyncEventQueueIds

    Set<String> getAsyncEventQueueIds()
    Returns a set of AsyncEventQueueIds added to the region
    Returns:
      a set of AsyncEventQueueIds added to the region

  - ### getConcurrencyChecksEnabled

    boolean getConcurrencyChecksEnabled()
    Returns true if concurrent update checks are turned on for this region.

    When this is enabled, concurrent updates will be conflated if they are applied out of order.

    All members must set this attribute the same. Default is set to true.

    Returns:
      true if concurrent update checks are turned on
    Since:
      GemFire 7.0

  - ### getCompressor

    Compressor getCompressor()
    Returns the compressor used by this region's entry values.
    Returns:
      null if the region does not have compression enabled.
    Since:
      GemFire 8.0

  - ### getOffHeap

    boolean getOffHeap()
    Returns whether or not this region uses off-heap memory.
    Returns:
      True if a usage of off-heap memory is enabled; false if usage of off-heap memory is disabled (default).
    Since:
      Geode 1.0