Gemfire JavaDocs
Package org.apache.geode.cache
Interface RegionAttributes<K,V>
-
public interface RegionAttributes<K,V>
Defines attributes for configuring a region. These areEvictionAttributes
,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 useAttributesFactory.createRegionAttributes()
. For compatibility rules and default values, seeAttributesFactory
.Note that the
RegionAttributes
are not distributed with the region.- Since:
- GemFire 2.0
- See Also:
AttributesFactory
,AttributesMutator
,Region.getAttributes()
,EvictionAttributes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getAsyncEventQueueIds()
Returns a set of AsyncEventQueueIds added to the regionCacheListener<K,V>
getCacheListener()
Deprecated.as of GemFire 5.0, usegetCacheListeners()
insteadCacheListener<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 theidleTimeout
CustomExpiry
, if any for entries in this regionCustomExpiry<K,V>
getCustomEntryTimeToLive()
Gets theentryTimeToLive
CustomExpiry
, if any for entries in this regionDataPolicy
getDataPolicy()
Returns the data policy for this region.java.io.File[]
getDiskDirs()
Deprecated.as of 6.5 useDiskStore.getDiskDirs()
instead.int[]
getDiskDirSizes()
Deprecated.as of 6.5 useDiskStore.getDiskDirSizes()
instead.java.lang.String
getDiskStoreName()
Returns the name of theDiskStore
that this region belongs to, if any.DiskWriteAttributes
getDiskWriteAttributes()
Deprecated.as of 6.5 usegetDiskStoreName()
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, usegetEnableSubscriptionConflation()
insteadboolean
getEnableConflation()
Deprecated.as of GemFire 5.0, usegetEnableSubscriptionConflation()
instead #boolean
getEnableSubscriptionConflation()
Returns whether or not conflation is enabled for sending messages from a cache server to its clients.ExpirationAttributes
getEntryIdleTimeout()
Gets theidleTimeout
expiration attributes for entries in this region.ExpirationAttributes
getEntryTimeToLive()
Gets thetimeToLive
expiration attributes for entries in this region.EvictionAttributes
getEvictionAttributes()
java.util.Set<java.lang.String>
getGatewaySenderIds()
Returns a set of gatewaysenderIdsboolean
getIgnoreJTA()
Gets the flag telling a region to ignore JTA transactions.boolean
getIndexMaintenanceSynchronous()
Returns the value ofIndexMaintenanceSynchronous
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.java.lang.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 removedMirrorType
getMirrorType()
Deprecated.as of GemFire 5.0, usegetDataPolicy()
instead.boolean
getMulticastEnabled()
Deprecated.since GemFire 10.boolean
getOffHeap()
Returns whether or not this region uses off-heap memory.PartitionAttributes<K,V>
getPartitionAttributes()
Returns thePartitionAttributes
that configure how the region is partitioned.boolean
getPersistBackup()
Deprecated.as of GemFire 5.0, useDataPolicy.PERSISTENT_REPLICATE
insteadjava.lang.String
getPoolName()
Returns the name of thePool
that this region will use to communicate with servers, if any.boolean
getPublisher()
Deprecated.as of 6.5ExpirationAttributes
getRegionIdleTimeout()
Gets the idleTimeout expiration attributes for the region as a whole.ExpirationAttributes
getRegionTimeToLive()
Gets thetimeToLive
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 theSubscriptionAttributes
that configure how this region behaves as a subscriber to remote caches.java.lang.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 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 aninstanceof
-
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 aninstanceof
-
getRegionTimeToLive
ExpirationAttributes getRegionTimeToLive()
Gets thetimeToLive
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 thetimeToLive
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 theidleTimeout
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 theentryTimeToLive
CustomExpiry
, if any for entries in this region- Returns:
- the entryTimeToLive CustomExpiry for entries in this region
-
getCustomEntryIdleTimeout
CustomExpiry<K,V> getCustomEntryIdleTimeout()
Gets theidleTimeout
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, 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 CacheListener<K,V> getCacheListener()
Deprecated.as of GemFire 5.0, usegetCacheListeners()
insteadReturns 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
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 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:
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, useDataPolicy.PERSISTENT_REPLICATE
insteadReturns 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 usegetDiskStoreName()
instead.Returns theDiskWriteAttributes
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 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 ofIndexMaintenanceSynchronous
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 thePartitionAttributes
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 removedReturns theMembershipAttributes
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 theSubscriptionAttributes
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.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 boolean 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 boolean 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 int[] 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
java.lang.String getPoolName()
Returns the name of thePool
that this region will use to communicate with servers, if any. Returnsnull
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()
-
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
-
-