VMware GemFire Java API Reference
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
RegionAttributesare 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.booleangetCloningEnabled()Returns whether or not cloning is enabled on region.CompressorgetCompressor()Returns the compressor used by this region's entry values.booleangetConcurrencyChecksEnabled()Returns true if concurrent update checks are turned on for this region.intgetConcurrencyLevel()Returns the concurrencyLevel of the entries map.CustomExpiry<K,V>getCustomEntryIdleTimeout()Gets theidleTimeoutCustomExpiry, if any for entries in this regionCustomExpiry<K,V>getCustomEntryTimeToLive()Gets theentryTimeToLiveCustomExpiry, if any for entries in this regionDataPolicygetDataPolicy()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.StringgetDiskStoreName()Returns the name of theDiskStorethat this region belongs to, if any.DiskWriteAttributesgetDiskWriteAttributes()Deprecated.as of 6.5 usegetDiskStoreName()instead.booleangetEarlyAck()Deprecated.Setting early ack no longer has any effect.booleangetEnableAsyncConflation()Returns whether or not async conflation is enabled for sending messages to async peers.booleangetEnableBridgeConflation()Deprecated.as of GemFire 5.0, usegetEnableSubscriptionConflation()insteadbooleangetEnableConflation()Deprecated.as of GemFire 5.0, usegetEnableSubscriptionConflation()instead #booleangetEnableSubscriptionConflation()Returns whether or not conflation is enabled for sending messages from a cache server to its clients.ExpirationAttributesgetEntryIdleTimeout()Gets theidleTimeoutexpiration attributes for entries in this region.ExpirationAttributesgetEntryTimeToLive()Gets thetimeToLiveexpiration attributes for entries in this region.TimeToLiveResetPolicygetEntryTimeToLiveResetPolicy()Gets the time-to-live reset policy used for entry time-to-live expiration in this region.EvictionAttributesgetEvictionAttributes()java.util.Set<java.lang.String>getGatewaySenderIds()Returns a set of gatewaysenderIdsbooleangetIgnoreJTA()Gets the flag telling a region to ignore JTA transactions.booleangetIndexMaintenanceSynchronous()Returns the value ofIndexMaintenanceSynchronouswhich specifies whether the region indexes are updated synchronously when a region is modified or asynchronously in a background thread.intgetInitialCapacity()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.floatgetLoadFactor()Returns the load factor of the entries map.MembershipAttributesgetMembershipAttributes()Deprecated.this API is scheduled to be removedMirrorTypegetMirrorType()Deprecated.as of GemFire 5.0, usegetDataPolicy()instead.booleangetMulticastEnabled()Deprecated.since GemFire 10.booleangetOffHeap()Returns whether or not this region uses off-heap memory.PartitionAttributes<K,V>getPartitionAttributes()Returns thePartitionAttributesthat configure how the region is partitioned.booleangetPersistBackup()Deprecated.as of GemFire 5.0, useDataPolicy.PERSISTENT_REPLICATEinsteadjava.lang.StringgetPoolName()Returns the name of thePoolthat this region will use to communicate with servers, if any.booleangetPublisher()Deprecated.as of 6.5ExpirationAttributesgetRegionIdleTimeout()Gets the idleTimeout expiration attributes for the region as a whole.ExpirationAttributesgetRegionTimeToLive()Gets thetimeToLiveexpiration attributes for the region as a whole.ScopegetScope()Returns the scope of the region.booleangetStatisticsEnabled()Returns whether the statistics are enabled for this region and its entries.SubscriptionAttributesgetSubscriptionAttributes()Returns theSubscriptionAttributesthat 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.booleanisDiskSynchronous()Returns true if configured synchronous disk writes.booleanisLockGrantor()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
Classthe keys must be aninstanceof
-
getValueConstraint
java.lang.Class<V> 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
-
getEntryTimeToLiveResetPolicy
TimeToLiveResetPolicy getEntryTimeToLiveResetPolicy()
Gets the time-to-live reset policy used for entry time-to-live expiration in this region.- Returns:
- the reset policy
-
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 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
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 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_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 DiskWriteAttributes 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 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 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<K,V> getPartitionAttributes()
Returns thePartitionAttributesthat configure how the region is partitioned.- Returns:
- the
PartitionAttributesthat configure how the region is partitioned - Since:
- GemFire 5.0
-
getMembershipAttributes
@Deprecated MembershipAttributes 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 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 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
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
-
-