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:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a set of AsyncEventQueueIds added to the regionDeprecated.CacheListener<K,V>[] Returns an array of all the cache listeners on this attributes.Returns the cache loader associated with this region.Returns the cache writer associated with this region.booleanReturns whether or not cloning is enabled on region.Returns the compressor used by this region's entry values.booleanReturns true if concurrent update checks are turned on for this region.intReturns the concurrencyLevel of the entries map.Gets theidleTimeoutCustomExpiry, if any for entries in this regionGets theentryTimeToLiveCustomExpiry, if any for entries in this regionReturns the data policy for this region.File[]Deprecated.as of 6.5 useDiskStore.getDiskDirs()instead.int[]Deprecated.as of 6.5 useDiskStore.getDiskDirSizes()instead.Returns the name of theDiskStorethat this region belongs to, if any.Deprecated.as of 6.5 usegetDiskStoreName()instead.booleanDeprecated.Setting early ack no longer has any effect.booleanReturns whether or not async conflation is enabled for sending messages to async peers.booleanDeprecated.as of GemFire 5.0, usegetEnableSubscriptionConflation()insteadbooleanDeprecated.as of GemFire 5.0, usegetEnableSubscriptionConflation()instead #booleanReturns whether or not conflation is enabled for sending messages from a cache server to its clients.Gets theidleTimeoutexpiration attributes for entries in this region.Gets thetimeToLiveexpiration attributes for entries in this region.Returns a set of gatewaysenderIdsbooleanGets the flag telling a region to ignore JTA transactions.booleanReturns the value ofIndexMaintenanceSynchronouswhich specifies whether the region indexes are updated synchronously when a region is modified or asynchronously in a background thread.intReturns the initial capacity of the entries map.Returns the class that the keys in this region are constrained to.floatReturns the load factor of the entries map.Deprecated.this API is scheduled to be removedDeprecated.as of GemFire 5.0, usegetDataPolicy()instead.booleanReturns true if multicast communications are enabled for this region.booleanReturns whether or not this region uses off-heap memory.Returns thePartitionAttributesthat configure how the region is partitioned.booleanDeprecated.as of GemFire 5.0, useDataPolicy.PERSISTENT_REPLICATEinsteadReturns the name of thePoolthat this region will use to communicate with servers, if any.booleanDeprecated.as of 6.5Gets the idleTimeout expiration attributes for the region as a whole.Gets thetimeToLiveexpiration attributes for the region as a whole.getScope()Returns the scope of the region.booleanReturns whether the statistics are enabled for this region and its entries.Returns theSubscriptionAttributesthat configure how this region behaves as a subscriber to remote caches.Returns the class that the values in this region are constrained to.booleanReturns true if configured synchronous disk writes.booleanReturns 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
Returns the class that the keys in this region are constrained to.- Returns:
- the
Classthe keys must be aninstanceof
-
getValueConstraint
Returns the class that the values in this region are constrained to.- Returns:
- the
Classthe values must be aninstanceof
-
getRegionTimeToLive
ExpirationAttributes getRegionTimeToLive()Gets thetimeToLiveexpiration 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 thetimeToLiveexpiration 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 theidleTimeoutexpiration 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 theentryTimeToLiveCustomExpiry, if any for entries in this region- Returns:
- the entryTimeToLive CustomExpiry for entries in this region
-
getCustomEntryIdleTimeout
CustomExpiry<K,V> getCustomEntryIdleTimeout()Gets theidleTimeoutCustomExpiry, 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.as of GemFire 5.0, usegetDataPolicy()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()- Returns:
- the region's EvictionAttributes
-
getCacheListener
Deprecated.as of GemFire 5.0, usegetCacheListeners()insteadReturns 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
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:
-
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:
-
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 notScope.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:
-
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:
-
getConcurrencyLevel
int getConcurrencyLevel()Returns the concurrencyLevel of the entries map. Default is 16.- Returns:
- the concurrencyLevel
- See Also:
-
getPersistBackup
Deprecated.as of GemFire 5.0, useDataPolicy.PERSISTENT_REPLICATEinsteadReturns 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.as of 6.5 usegetDiskStoreName()instead.Returns theDiskWriteAttributesthat configure how the region is written to disk.- Returns:
- the
DiskWriteAttributesthat configure how the region is written to disk - Since:
- GemFire 3.2
-
getDiskDirs
Deprecated.as of 6.5 useDiskStore.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 ofIndexMaintenanceSynchronouswhich 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 thePartitionAttributesthat configure how the region is partitioned.- Returns:
- the
PartitionAttributesthat configure how the region is partitioned - Since:
- GemFire 5.0
-
getMembershipAttributes
Deprecated.this API is scheduled to be removedReturns theMembershipAttributesthat configure required roles for reliable access to the region.- Returns:
- the
MembershipAttributesthat configure required roles for reliable access to the region
-
getSubscriptionAttributes
SubscriptionAttributes getSubscriptionAttributes()Returns theSubscriptionAttributesthat configure how this region behaves as a subscriber to remote caches.- Returns:
- the
SubscriptionAttributesthat 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.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.as of 6.5Returns 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.as of GemFire 5.0, usegetEnableSubscriptionConflation()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.as of GemFire 5.0, usegetEnableSubscriptionConflation()insteadReturns 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.as of 6.5 useDiskStore.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 thePoolthat this region will use to communicate with servers, if any. Returnsnullif this region communicates with peers.- Returns:
- the name of the client-server
Poolthis region will use for server communication;nullis 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() -
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
Returns a set of gatewaysenderIds- Returns:
- a set of gatewaysenderIds
-
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
-
getCacheListeners()instead