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 Detail

      • 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

        java.lang.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

        java.lang.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
      • 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:
        java.lang.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 CacheListeners; 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

        @Deprecated
        boolean getMulticastEnabled()
        Deprecated.
        since GemFire 10. Any attempt to set the value to true will result in an exception as TCP based communication is the default, and it does not support multicast.
        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
        java.io.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<K,​V> 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

        java.lang.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

        java.lang.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

        java.util.Set<java.lang.String> getGatewaySenderIds()
        Returns a set of gatewaysenderIds
        Returns:
        a set of gatewaysenderIds
      • getAsyncEventQueueIds

        java.util.Set<java.lang.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