Creates instances of
RegionAttributes. An
AttributesFactory
instance maintains state for creating
RegionAttributes
instances.
The setter methods are used to change the settings that will be used for
creating the next attributes instance with the
#createmethod. If you create a factory with the default constructor, then the
factory is set up to create attributes with all default settings. You can
also create a factory by providing a
RegionAttributes
, which
will set up the new factory with the settings provided in that attributes
instance.
Once a RegionAttributes
is created, it can only be modified
after it has been used to create a Region
, and then only by
using an
AttributesMutator obtained from the region.
Attributes
Callbacks
CacheLoader [
default: null
, meaning no loader]
User-implemented plug-in for loading data on cache misses.
#setCacheLoader
RegionAttributes#getCacheLoaderAttributesMutator#setCacheLoader
CacheWriter [
default: null
, meaning no writer]
User-implemented plug-in for intercepting cache modifications, e.g.
for writing to an external data source.
#setCacheWriter
RegionAttributes#getCacheWriterAttributesMutator#setCacheWriter
CacheListener [
default: null
, meaning no listener ]
User-implemented plug-in for receiving and handling cache related events.
#addCacheListener
#initCacheListeners#initCacheListenersRegionAttributes#getCacheListenersAttributesMutator#initCacheListenersAttributesMutator#addCacheListenerAttributesMutator#removeCacheListener
Expiration
RegionTimeToLive [
default: no expiration]
Expiration configuration for the entire region based on the
CacheStatistics#getLastModifiedTime.
#setRegionTimeToLive
RegionAttributes#getRegionTimeToLiveAttributesMutator#setRegionTimeToLive
RegionIdleTimeout [
default: no expiration]
Expiration configuration for the entire region based on the
CacheStatistics#getLastAccessedTime.
#setRegionIdleTimeout
RegionAttributes#getRegionIdleTimeoutAttributesMutator#setRegionIdleTimeout
EntryTimeToLive [
default: no expiration]
Expiration configuration for individual entries based on the
CacheStatistics#getLastModifiedTime.
#setEntryTimeToLive
RegionAttributes#getEntryTimeToLiveAttributesMutator#setEntryTimeToLive
EntryIdleTimeout [
default: no expiration]
Expiration configuration for individual entries based on the
CacheStatistics#getLastAccessedTime.
#setEntryIdleTimeout
RegionAttributes#getEntryIdleTimeoutAttributesMutator#setEntryIdleTimeout
Distribution
Scope[
default:
Scope#DISTRIBUTED_NO_ACK]
Properties of distribution for the region, including whether it is
distributed at all, whether acknowledgements are required, and whether
distributed synchronization is required.
#setScope
RegionAttributes#getScope
EarlyAck [
default: false
]
Whether or not acks required by
Scope.DISTRIBUTED_ACK
are sent after an operation is processed. If
true
then remote caches will ACK before processing an operation sent
by the cache that has set earlyAck to
true
.
Note that this attribute is only meaningful on the cache that
is initiating an operation; it does not matter what it is set to
on the cache that receives the operation.
#setEarlyAck
RegionAttributes#getEarlyAck
SubscriptionAttributes [
default:
InterestPolicy#DEFAULT]
How will the region in this cache subscribe to other distributed
instances of this region.
#setSubscriptionAttributes
RegionAttributes#getSubscriptionAttributes
EnableAsyncConflation [
default: false
]
Whether or not conflation is enabled for sending
messages to async peers. Async peers are those whose
async-distribution-timeout
gemfire.property is greater
than zero. AsyncConflation is ignored if the scope is
DISTRIBUTED_ACK
or
GLOBAL
.
Conflation is only done on entry update operations. It is done
by dropping the earlier update from the message queue.
#setEnableAsyncConflation
RegionAttributes#getEnableAsyncConflation
poolName [
default: null
, meaning no pool]
Whether or not this region is a client that is to use
connections from the named pool to communicate with servers.
If
null
, then it is not a client.
If
non-null
, then the named pool will be used.
#setPoolName
RegionAttributes#getPoolName
EnableSubscriptionConflation [
default: false
]
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.
If
true
, messages will be conflated before they are
sent from a cache server to its clients. Only the latest value
will be sent.
Note that this attribute is only meaningful in a client server
topology.
#setEnableSubscriptionConflation
RegionAttributes#getEnableSubscriptionConflation
Publisher [
default: false
]
Whether or not a region is a publisher. Publishers are regions
that will have distributed write operations done on them.
If a publisher is also a replicate then it will be used
as the preferred source for initializing other replicates.
#setPublisher
RegionAttributes#getPublisher
isCloningEnabled [
default: false
]
Whether or not value is cloned before appling
Delta
s
If
false
, value will not be cloned
#setCloningEnabled
RegionAttributes#getCloningEnabled()
DataPolicy [
default: DataPolicy.NORMAL
]
Specifies the data storage policy.
#setDataPolicy
RegionAttributes#getDataPolicy
MirrorType [
default: MirrorType.NONE
]
Deprecated, use DataPolicy instead.
#setEvictionAttributes(EvictionAttributes)
EvictionAttributes are the replacement for the deprecated and removed CapacityController interface.
EvictionAttributes describe the
EvictionAlgorithm and the
EvictionActionas well as the various conditions under which the algorithm perform the action
e.g. when the maximum number of entries has been reached or
the maximum percentage of JVM heap has been consumed.
Setting
EvictionAttributes
installs an eviction controller
on the Region instantiated with the associated RegionAttributes
KeyConstraint [
default: null
, meaning no constraint]
The Class to constrain the keys to in the region.
#setKeyConstraint
RegionAttributes#getKeyConstraint
ValueConstraint [
default: null
, meaning no constraint]
The Class to constrain the values to in the region. In addition to the
utility of this for applications in general, a
valueConstraint
is helpful for compiling queries.
#setValueConstraint
RegionAttributes#getValueConstraint
InitialCapacity [
default: 16
]
The initial capacity of the map used for storing the entries.
java.util.HashMap
#setInitialCapacityRegionAttributes#getInitialCapacity
LoadFactor [
default: 0.75
]
The load factor of the map used for storing the entries.
java.util.HashMap
#setLoadFactorRegionAttributes#getLoadFactor
ConcurrencyLevel [
default: 16
]
The allowed concurrency among updates to values in the region is guided
by the concurrencyLevel, which is used as a hint for internal
sizing. The actual concurrency will vary. Ideally, you should choose a value
to accommodate as many threads as will ever concurrently modify values in the
region. Using a significantly higher value than you need can waste space and
time, and a significantly lower value can lead to thread contention. But
overestimates and underestimates within an order of magnitude do not usually
have much noticeable impact. A value of one is appropriate when it is known
that only one thread will modify and all others will only read.
#setConcurrencyLevel
RegionAttributes#getConcurrencyLevel
ConcurrencyChecksEnabled [
default: false
]
Enables a distributed versioning algorithm that detects concurrency
conflicts in regions and ensures that changes to an
entry are not applied in a different order in other members. This can
cause operations to be conflated, so that some cache listeners may see
an event while others do not, but it guarantees that the system will
be consistent.
StatisticsEnabled [
default: false
]
Whether statistics are enabled for this region. The default is disabled,
which conserves on memory.
#setStatisticsEnabled
RegionAttributes#getStatisticsEnabled
IgnoreJTA [
default: false
]
Whether JTA transactions are ignored for this region. The
default is to look for and join JTA transactions for operations
performed on a region.
DiskStoreName [
default: null
, meaning no disk store]
If not
null
then this region will write its data
to the named
DiskStore.
#setDiskStoreName
RegionAttributes#getDiskStoreName
DiskSynchronous [
default: true
]
If
true
then any writes to disk done for this region
will be done synchronously. This means that they will be in the file system
buffer before the operation doing the write returns.
If
false
then any writes to disk done for this region
will be done asynchronously. This means that they are queued up to be written
and when they are actually written to the file system buffer is determined
by the region's
DiskStore configuration.
Asynchronous writes will be conflated if the same entry is written while a
previous operation for the same entry is still in the queue.
#setDiskSynchronous
RegionAttributes#isDiskSynchronous
PersistBackup [
default: false
]
Whether or not a persistent backup should be made of the
region.
#setPersistBackup
RegionAttributes#getPersistBackup
Deprecated, use
DataPolicy#PERSISTENT_REPLICATE or
DataPolicy#PERSISTENT_PARTITION instead.
DiskWriteAttributes [
default: Asynchronously write to
disk every second (a
timeInterval
of 1000 and a
byteThreshold
of 0).
rollOplogs
is set to true and
maxOplogSize
is set to 1024 MB]
How region data should be written to disk. Determines
whether data should be written synchronously or asynchronously.
Data that is written asynchronously can be written at a certain
DiskWriteAttributes#getTimeIntervalor once a certain number of
DiskWriteAttributes#getBytesThreshold have been
enqueued.
DiskWriteAttributes
#setDiskWriteAttributes
RegionAttributes#getDiskWriteAttributes
Deprecated, use
#setDiskStoreName and
#setDiskSynchronous instead.
DiskDirs [
default: Current working directory (
user.dir
System#getProperties)]
The directories to which the region's data are written. If
multiple directories are used, GemFire will attempt to distribute the
data evenly among them.
#setDiskDirs
RegionAttributes#getDiskDirs
Deprecated, use
#setDiskStoreName instead.
DiskDirSizes [
default: 10240 MB]
The size of the directory to which region's data is written.
#setDiskDirsAndSizes
RegionAttributes#getDiskDirSizes
Deprecated, use
#setDiskStoreName instead.
PartitionAttributes [
default: null
, meaning no region partitioning]
How region data is partitioned among the members of the
distributed system.
#setPartitionAttributes
RegionAttributes#getPartitionAttributes
MembershipAttributes [
default: no required roles]
How access to the region is affected when one or more required roles
are missing from the region membership.
#setMembershipAttributes
RegionAttributes#getMembershipAttributes
Locking
LockGrantor [
default: false
]
Should this process become lock grantor for the region?
#setLockGrantor
RegionAttributes#isLockGrantorRegion#becomeLockGrantor
Querying
IndexMaintenanceSynchronous [
default: false
]
Are indexes built over in this region updated
synchronously when the underlying data is
modified?
#setIndexMaintenanceSynchronous
RegionAttributes#getIndexMaintenanceSynchronous
Note that the RegionAttributes are not distributed with the region.
Compatibility Rules
RegionAttributes Creation Constraints
If any of the following compatibility rules are violated when
#create is called then an
IllegalStateException is thrown.
See
#validateAttributes.
Creation Constraints
Region Creation Constraints on RegionAttributes
If any of the following rules are violated when
Region#createSubregion or
Cache#createRegion are called, then an
IllegalStateException
is thrown.
- A region with
Scope.LOCAL
can only have subregions with
Scope.LOCAL
.
Scope.GLOBAL
is illegal if there is any other cache in
the distributed system that has the same region with
Scope.DISTRIBUTED_NO_ACK
or Scope.DISTRIBUTED_ACK
.
Scope.DISTRIBUTED_ACK
is illegal if there is any other
cache in the distributed system that has the same region with
Scope.DISTRIBUTED_NO_ACK
or Scope.GLOBAL
.
Scope.DISTRIBUTED_NO_ACK
is illegal if there is any other
cache in the distributed system that has the same region with
Scope.DISTRIBUTED_ACK
or Scope.GLOBAL
.