GemFire 6.5.1.2

com.gemstone.gemfire.cache
Class AttributesFactory<K,V>

java.lang.Object
  extended by com.gemstone.gemfire.cache.AttributesFactory<K,V>

public class AttributesFactory<K,V>
extends Object

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 create() method. 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(com.gemstone.gemfire.cache.CacheLoader) RegionAttributes.getCacheLoader() AttributesMutator.setCacheLoader(com.gemstone.gemfire.cache.CacheLoader)
CacheWriter [default: null, meaning no writer]
User-implemented plug-in for intercepting cache modifications, e.g. for writing to an external data source.
setCacheWriter(com.gemstone.gemfire.cache.CacheWriter) RegionAttributes.getCacheWriter() AttributesMutator.setCacheWriter(com.gemstone.gemfire.cache.CacheWriter)
CacheListener [default: null, meaning no listener ]
User-implemented plug-in for receiving and handling cache related events.
addCacheListener(com.gemstone.gemfire.cache.CacheListener) initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) RegionAttributes.getCacheListeners() AttributesMutator.initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) AttributesMutator.addCacheListener(com.gemstone.gemfire.cache.CacheListener) AttributesMutator.removeCacheListener(com.gemstone.gemfire.cache.CacheListener)

Expiration

RegionTimeToLive [default: no expiration]
Expiration configuration for the entire region based on the lastModifiedTime.
setRegionTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes) RegionAttributes.getRegionTimeToLive() AttributesMutator.setRegionTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)
RegionIdleTimeout [default: no expiration]
Expiration configuration for the entire region based on the lastAccessedTime.
setRegionIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes) RegionAttributes.getRegionIdleTimeout() AttributesMutator.setRegionIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)
EntryTimeToLive [default: no expiration]
Expiration configuration for individual entries based on the lastModifiedTime.
setEntryTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes) RegionAttributes.getEntryTimeToLive() AttributesMutator.setEntryTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)
EntryIdleTimeout [default: no expiration]
Expiration configuration for individual entries based on the lastAccessedTime.
setEntryIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes) RegionAttributes.getEntryIdleTimeout() AttributesMutator.setEntryIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)

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(com.gemstone.gemfire.cache.Scope) 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(boolean) RegionAttributes.getEarlyAck()
SubscriptionAttributes [default: InterestPolicy.DEFAULT]
How will the region in this cache subscribe to other distributed instances of this region.
setSubscriptionAttributes(com.gemstone.gemfire.cache.SubscriptionAttributes) 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(boolean) 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(java.lang.String) RegionAttributes.getPoolName()
EnableGateway [default: false]
Whether or not updates are sent to any defined Gateways If true, updates will be sent to all defined Gateways after they are applied to the local cache. Note that this attribute is only meaningful on a cache that defines Gateways.
setEnableGateway(boolean) RegionAttributes.getEnableGateway()
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(boolean) 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(boolean) RegionAttributes.getPublisher()
isCloningEnabled [default: false]
Whether or not value is cloned before appling Deltas If false, value will not be cloned setCloningEnabled(boolean) RegionAttributes.getCloningEnabled()

Storage (see also package summary )

DataPolicy [default: DataPolicy.NORMAL]
Specifies the data storage policy.
setDataPolicy(com.gemstone.gemfire.cache.DataPolicy) RegionAttributes.getDataPolicy()
MirrorType [default: MirrorType.NONE]
Deprecated, use DataPolicy instead.
EvictionAttributes
EvictionAttributes are the replacement for the deprecated and removed CapacityController interface. EvictionAttributes describe the EvictionAlgorithm and the EvictionAction as 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(java.lang.Class) 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(java.lang.Class) RegionAttributes.getValueConstraint()
InitialCapacity [default: 16]
The initial capacity of the map used for storing the entries.
HashMap setInitialCapacity(int) RegionAttributes.getInitialCapacity()
LoadFactor [default: 0.75]
The load factor of the map used for storing the entries.
HashMap setLoadFactor(float) RegionAttributes.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(int) RegionAttributes.getConcurrencyLevel()
StatisticsEnabled [default: false]
Whether statistics are enabled for this region. The default is disabled, which conserves on memory.
setStatisticsEnabled(boolean) 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(java.lang.String) 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(boolean) RegionAttributes.isDiskSynchronous()
PersistBackup [default: false]
Whether or not a persistent backup should be made of the region.
setPersistBackup(boolean) 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 time interval or once a certain number of bytes of data have been enqueued.
DiskWriteAttributes setDiskWriteAttributes(com.gemstone.gemfire.cache.DiskWriteAttributes) RegionAttributes.getDiskWriteAttributes()
Deprecated, use setDiskStoreName(java.lang.String) and setDiskSynchronous(boolean) instead.
DiskDirs [default: Current working directory (user.dir system property)]
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(java.io.File[]) RegionAttributes.getDiskDirs()
Deprecated, use setDiskStoreName(java.lang.String) instead.
DiskDirSizes [default: 10240 MB]
The size of the directory to which region's data is written.
setDiskDirsAndSizes(java.io.File[], int[]) RegionAttributes.getDiskDirSizes()
Deprecated, use setDiskStoreName(java.lang.String) instead.
PartitionAttributes [default: null, meaning no region partitioning]
How region data is partitioned among the members of the distributed system.
setPartitionAttributes(com.gemstone.gemfire.cache.PartitionAttributes) 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(com.gemstone.gemfire.cache.MembershipAttributes) RegionAttributes.getMembershipAttributes()

Locking

LockGrantor [default: false]
Should this process become lock grantor for the region?

setLockGrantor(boolean) RegionAttributes.isLockGrantor() Region.becomeLockGrantor()

Querying

IndexMaintenanceSynchronous [default: false]
Are indexes built over in this region updated synchronously when the underlying data is modified?

setIndexMaintenanceSynchronous(boolean) 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(com.gemstone.gemfire.cache.RegionAttributes).

Creation Constraints

Region Creation Constraints on RegionAttributes

If any of the following rules are violated when
createSubregion or createRegion are called, then an IllegalStateException is thrown.

Since:
3.0
See Also:
RegionAttributes, AttributesMutator, Region.createSubregion(String, RegionAttributes)

Field Summary
static boolean DEFAULT_DISK_SYNCHRONOUS
          The default disk synchronous write setting Current value: true each.
 
Constructor Summary
AttributesFactory()
          Creates a new instance of AttributesFactory ready to create a RegionAttributes with default settings.
AttributesFactory(RegionAttributes<K,V> regionAttributes)
          Creates a new instance of AttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes.
 
Method Summary
 void addCacheListener(CacheListener<K,V> aListener)
          Adds a cache listener to the end of the list of cache listeners on this factory.
 RegionAttributes<K,V> create()
          Creates a RegionAttributes with the current settings.
 RegionAttributes<K,V> createRegionAttributes()
          Deprecated. as of GemFire 5.0, use create() instead
 void initCacheListeners(CacheListener<K,V>[] newListeners)
          Removes all cache listeners and then adds each listener in the specified array.
 void setCacheListener(CacheListener<K,V> aListener)
          Deprecated. as of GemFire 5.0, use addCacheListener(com.gemstone.gemfire.cache.CacheListener) instead.
 void setCacheLoader(CacheLoader<K,V> cacheLoader)
          Sets the cache loader for the next RegionAttributes created.
 void setCacheWriter(CacheWriter<K,V> cacheWriter)
          Sets the cache writer for the next RegionAttributes created.
 void setCloningEnabled(boolean cloningEnable)
          Sets cloning on region
 void setConcurrencyLevel(int concurrencyLevel)
          Sets the concurrency level of the next RegionAttributes created.
 void setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
          Sets the idleTimeout CustomExpiry for the next RegionAttributes created.
 void setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
          Sets the custom timeToLive for the next RegionAttributes created.
 void setDataPolicy(DataPolicy dataPolicy)
          Sets the data policy for the next RegionAttributes created.
 void setDiskDirs(File[] diskDirs)
          Deprecated. as of 6.5 use DiskStoreFactory.setDiskDirs(java.io.File[]) instead
 void setDiskDirsAndSizes(File[] diskDirs, int[] diskSizes)
          Deprecated. as of 6.5 use DiskStoreFactory.setDiskDirsAndSizes(java.io.File[], int[]) instead
 void setDiskStoreName(String name)
          Sets the DiskStore name attribute.
 void setDiskSynchronous(boolean isSynchronous)
          Sets whether or not the writing to the disk is synchronous.
 void setDiskWriteAttributes(DiskWriteAttributes attrs)
          Deprecated. as of 6.5 use setDiskStoreName(java.lang.String) instead
 void setEarlyAck(boolean earlyAck)
          Deprecated. This setting no longer has any effect.
 void setEnableAsyncConflation(boolean enableAsyncConflation)
          Sets whether or not conflation is enabled for sending messages to async peers.
 void setEnableBridgeConflation(boolean enableBridgeConflation)
          Deprecated. as of 5.7 use setEnableSubscriptionConflation(boolean) instead.
 void setEnableConflation(boolean enableBridgeConflation)
          Deprecated. as of GemFire 5.0, use setEnableSubscriptionConflation(boolean)
 void setEnableGateway(boolean enableGateway)
          Sets whether or not updates are sent to defined Gateways.
 void setEnableSubscriptionConflation(boolean enableSubscriptionConflation)
          Sets whether or not conflation is enabled for sending messages from a cache server to its clients.
 void setEnableWAN(boolean enableGateway)
          Deprecated. as of GemFire 5.0, use setEnableGateway(boolean)
 void setEntryIdleTimeout(ExpirationAttributes idleTimeout)
          Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.
 void setEntryTimeToLive(ExpirationAttributes timeToLive)
          Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.
 void setEvictionAttributes(EvictionAttributes evictAttrs)
          Sets the EvictionController for the next RegionAttributes created.
 void setGatewayHubId(String gatewayHubId)
          Sets the id of the GatewayHub to which events are distributed.
 void setIgnoreJTA(boolean flag)
          Sets the flag telling a region to ignore JTA transactions
 void setIndexMaintenanceSynchronous(boolean synchronous)
          Set how indexes on the region should be maintained.
 void setInitialCapacity(int initialCapacity)
          Sets the entry initial capacity for the next RegionAttributes created.
 void setKeyConstraint(Class<K> keyConstraint)
          Sets the key constraint for the next RegionAttributes created.
 void setLoadFactor(float loadFactor)
          Sets the entry load factor for the next RegionAttributes created.
 void setLockGrantor(boolean isLockGrantor)
          Sets whether this region should become lock grantor.
 void setMembershipAttributes(MembershipAttributes membership)
          Sets the MembershipAttributes that describe the membership roles required for reliable access to the region.
 void setMirrorType(MirrorType mirrorType)
          Deprecated. use setDataPolicy(com.gemstone.gemfire.cache.DataPolicy) instead.
 void setMulticastEnabled(boolean value)
          Sets whether distributed operations on this region should attempt to use multicast.
 void setPartitionAttributes(PartitionAttributes partition)
          Sets the PartitionAttributes that describe how the region is partitioned among members of the distributed system.
 void setPersistBackup(boolean persistBackup)
          Deprecated. as of GemFire 5.0, use DataPolicy.PERSISTENT_REPLICATE instead
 void setPoolName(String name)
          Sets the pool name attribute.
 void setPublisher(boolean v)
          Deprecated. as of 6.5
 void setRegionIdleTimeout(ExpirationAttributes idleTimeout)
          Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.
 void setRegionTimeToLive(ExpirationAttributes timeToLive)
          Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.
 void setScope(Scope scopeType)
          Sets the scope for the next RegionAttributes created.
 void setStatisticsEnabled(boolean statisticsEnabled)
          Sets whether statistics are enabled for this region and its entries.
 void setSubscriptionAttributes(SubscriptionAttributes subscription)
          Sets the SubscriptionAttributes that describe how the region will subscribe to other distributed cache instances of the region.
 void setValueConstraint(Class<V> valueConstraint)
          Sets the value constraint for the next RegionAttributes created.
static void validateAttributes(RegionAttributes<?,?> attrs)
          Validates that the attributes are consistent with each other.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DISK_SYNCHRONOUS

public static final boolean DEFAULT_DISK_SYNCHRONOUS
The default disk synchronous write setting

Current value: true each.

Since:
6.5
See Also:
Constant Field Values
Constructor Detail

AttributesFactory

public AttributesFactory()
Creates a new instance of AttributesFactory ready to create a RegionAttributes with default settings.


AttributesFactory

public AttributesFactory(RegionAttributes<K,V> regionAttributes)
Creates a new instance of AttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes.

Parameters:
regionAttributes - the RegionAttributes used to initialize this AttributesFactory
Method Detail

setCacheLoader

public void setCacheLoader(CacheLoader<K,V> cacheLoader)
Sets the cache loader for the next RegionAttributes created.

Parameters:
cacheLoader - the cache loader or null if no loader
Throws:
IllegalStateException - if this region has a pool name set

setCacheWriter

public void setCacheWriter(CacheWriter<K,V> cacheWriter)
Sets the cache writer for the next RegionAttributes created.

Parameters:
cacheWriter - the cache writer or null if no cache writer
Throws:
IllegalStateException - if this region has a pool name set

setCacheListener

@Deprecated
public void setCacheListener(CacheListener<K,V> aListener)
Deprecated. as of GemFire 5.0, use addCacheListener(com.gemstone.gemfire.cache.CacheListener) instead.

Sets the CacheListener for the next RegionAttributes created. Any existing cache listeners on this factory are removed.

Parameters:
aListener - a user defined CacheListener, null if no listener

addCacheListener

public void addCacheListener(CacheListener<K,V> aListener)
Adds a cache listener to the end of the list of cache listeners on this factory.

Parameters:
aListener - the cache listener to add to the factory.
Throws:
IllegalArgumentException - if aListener is null
Since:
5.0

initCacheListeners

public void initCacheListeners(CacheListener<K,V>[] newListeners)
Removes all cache listeners and then adds each listener in the specified array.

Parameters:
newListeners - a possibly null or empty array of listeners to add to this factory.
Throws:
IllegalArgumentException - if the newListeners array has a null element
Since:
5.0

setEntryIdleTimeout

public void setEntryIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.

Parameters:
idleTimeout - the idleTimeout ExpirationAttributes for entries in this region
Throws:
IllegalArgumentException - if idleTimeout is null

setCustomEntryIdleTimeout

public void setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
Sets the idleTimeout CustomExpiry for the next RegionAttributes created.

Parameters:
custom - the CustomExpiry to use; null means none will be used.

setEntryTimeToLive

public void setEntryTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.

Parameters:
timeToLive - the timeToLive ExpirationAttributes for entries in this region
Throws:
IllegalArgumentException - if timeToLive is null

setCustomEntryTimeToLive

public void setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
Sets the custom timeToLive for the next RegionAttributes created.

Parameters:
custom - the CustomExpiry to use, none if the default for the region is to be used.

setRegionIdleTimeout

public void setRegionIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
idleTimeout - the ExpirationAttributes for this region idleTimeout
Throws:
IllegalArgumentException - if idleTimeout is null

setRegionTimeToLive

public void setRegionTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
timeToLive - the ExpirationAttributes for this region timeToLive
Throws:
IllegalArgumentException - if timeToLive is null

setScope

public void setScope(Scope scopeType)
Sets the scope for the next RegionAttributes created.

Parameters:
scopeType - the type of Scope to use for the region
Throws:
IllegalArgumentException - if scopeType is null

setEvictionAttributes

public void setEvictionAttributes(EvictionAttributes evictAttrs)
Sets the EvictionController for the next RegionAttributes created. Use one of the creation methods on EvictionAttributes e.g. EvictionAttributes.createLRUHeapAttributes() to create the desired instance for this AttributesFactory

Parameters:
evictAttrs - Explains how and when eviction occurs in the Region.

setMirrorType

@Deprecated
public void setMirrorType(MirrorType mirrorType)
Deprecated. use setDataPolicy(com.gemstone.gemfire.cache.DataPolicy) instead.

Sets the mirror type for the next RegionAttributes created.

Parameters:
mirrorType - The type of mirroring to use for the region
Throws:
IllegalArgumentException - if mirrorType is null

setDataPolicy

public void setDataPolicy(DataPolicy dataPolicy)
Sets the data policy for the next RegionAttributes created.

Parameters:
dataPolicy - The data policy to use for the region
Throws:
IllegalArgumentException - if dataPolicy is null

setKeyConstraint

public void setKeyConstraint(Class<K> keyConstraint)
Sets the key constraint for the next RegionAttributes created. Keys in the region will be constrained to this class (or subclass). Any attempt to store a key of an incompatible type in the region will cause a ClassCastException to be thrown.

Parameters:
keyConstraint - The Class to constrain the keys to, or null if no constraint
Throws:
IllegalArgumentException - if keyConstraint is a class denoting a primitive type

setValueConstraint

public void setValueConstraint(Class<V> valueConstraint)
Sets the value constraint for the next RegionAttributes created. Values in the region will be constrained to this class (or subclass). Any attempt to store a value of an incompatible type in the region will cause a ClassCastException to be thrown.

Parameters:
valueConstraint - The Class to constrain the values to, or null if no constraint
Throws:
IllegalArgumentException - if valueConstraint is a class denoting a primitive type

setInitialCapacity

public void setInitialCapacity(int initialCapacity)
Sets the entry initial capacity for the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
initialCapacity - the initial capacity of the entry map
Throws:
IllegalArgumentException - if initialCapacity is negative.
See Also:
HashMap

setLoadFactor

public void setLoadFactor(float loadFactor)
Sets the entry load factor for the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
loadFactor - the load factor of the entry map
Throws:
IllegalArgumentException - if loadFactor is nonpositive
See Also:
HashMap

setConcurrencyLevel

public void setConcurrencyLevel(int concurrencyLevel)
Sets the concurrency level of the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
concurrencyLevel - the concurrency level of the entry map
Throws:
IllegalArgumentException - if concurrencyLevel is nonpositive

setPersistBackup

@Deprecated
public void setPersistBackup(boolean persistBackup)
Deprecated. as of GemFire 5.0, use DataPolicy.PERSISTENT_REPLICATE instead

Sets whether or not a persistent backup should be made of the region.

Since:
3.2

setEarlyAck

@Deprecated
public void setEarlyAck(boolean earlyAck)
Deprecated. This setting no longer has any effect.

Sets whether or not acks are sent after an operation is processed.

Since:
4.1

setEnableGateway

public void setEnableGateway(boolean enableGateway)
Sets whether or not updates are sent to defined Gateways.

Since:
5.0

setGatewayHubId

public void setGatewayHubId(String gatewayHubId)
Sets the id of the GatewayHub to which events are distributed.

Parameters:
gatewayHubId - the id of the GatewayHub
Since:
5.1

setEnableWAN

@Deprecated
public void setEnableWAN(boolean enableGateway)
Deprecated. as of GemFire 5.0, use setEnableGateway(boolean)

Sets whether or not updates are sent to defined Gateways.

Since:
4.2

setPublisher

@Deprecated
public void setPublisher(boolean v)
Deprecated. as of 6.5

Sets whether or not this region should be considered a publisher.

Since:
4.2.3

setEnableAsyncConflation

public void setEnableAsyncConflation(boolean enableAsyncConflation)
Sets whether or not conflation is enabled for sending messages to async peers.

Since:
4.2.3

setEnableSubscriptionConflation

public void setEnableSubscriptionConflation(boolean enableSubscriptionConflation)
Sets whether or not conflation is enabled for sending messages from a cache server to its clients.

Since:
5.0

setEnableBridgeConflation

@Deprecated
public void setEnableBridgeConflation(boolean enableBridgeConflation)
Deprecated. as of 5.7 use setEnableSubscriptionConflation(boolean) instead.

Sets whether or not conflation is enabled for sending messages from a cache server to its clients.

Since:
5.0

setEnableConflation

@Deprecated
public void setEnableConflation(boolean enableBridgeConflation)
Deprecated. as of GemFire 5.0, use setEnableSubscriptionConflation(boolean)

Sets whether or not conflation is enabled for sending messages from a cache server to its clients.


setDiskWriteAttributes

public void setDiskWriteAttributes(DiskWriteAttributes attrs)
Deprecated. as of 6.5 use setDiskStoreName(java.lang.String) instead

Returns whether or not disk writes are asynchronous.

Since:
3.2
See Also:
Region.writeToDisk()

setDiskDirs

public void setDiskDirs(File[] diskDirs)
Deprecated. as of 6.5 use DiskStoreFactory.setDiskDirs(java.io.File[]) instead

Sets the directories with the default size of 10240 MB to which the region's data is written

Throws:
IllegalArgumentException - if a directory does not exist
Since:
3.2

setDiskStoreName

public void setDiskStoreName(String name)
Sets the DiskStore name attribute. This causes the region to use the DiskStore.

Parameters:
name - the name of the diskstore
Since:
6.5

setDiskSynchronous

public void setDiskSynchronous(boolean isSynchronous)
Sets whether or not the writing to the disk is synchronous.

Parameters:
isSynchronous - boolean if true indicates synchronous writes
Since:
6.5

setDiskDirsAndSizes

public void setDiskDirsAndSizes(File[] diskDirs,
                                int[] diskSizes)
Deprecated. as of 6.5 use DiskStoreFactory.setDiskDirsAndSizes(java.io.File[], int[]) instead

Sets the directories to which the region's data is written and also set their sizes in megabytes

Throws:
IllegalArgumentException - if a dir does not exist or the length of the size array does not match to the length of the dir array or the given length is not a valid positive number
Since:
5.1

setPartitionAttributes

public void setPartitionAttributes(PartitionAttributes partition)
Sets the PartitionAttributes that describe how the region is partitioned among members of the distributed system. This also establishes a data policy of PARTITION, if the data policy has not already been set.

Since:
5.0

setMembershipAttributes

public void setMembershipAttributes(MembershipAttributes membership)
Sets the MembershipAttributes that describe the membership roles required for reliable access to the region.

Since:
5.0

setSubscriptionAttributes

public void setSubscriptionAttributes(SubscriptionAttributes subscription)
Sets the SubscriptionAttributes that describe how the region will subscribe to other distributed cache instances of the region.

Since:
5.0

setIndexMaintenanceSynchronous

public void setIndexMaintenanceSynchronous(boolean synchronous)
Set how indexes on the region should be maintained. It will be either synchronous or asynchronous.


setStatisticsEnabled

public void setStatisticsEnabled(boolean statisticsEnabled)
Sets whether statistics are enabled for this region and its entries.

Parameters:
statisticsEnabled - whether statistics are enabled

setIgnoreJTA

public void setIgnoreJTA(boolean flag)
Sets the flag telling a region to ignore JTA transactions

Since:
5.0

setLockGrantor

public void setLockGrantor(boolean isLockGrantor)
Sets whether this region should become lock grantor.

Parameters:
isLockGrantor - whether this region should become lock grantor

setMulticastEnabled

public void setMulticastEnabled(boolean value)
Sets whether distributed operations on this region should attempt to use multicast. Multicast must also be enabled in the cache's DistributedSystem (see "mcast-port").

Since:
5.0
See Also:
RegionAttributes.getMulticastEnabled()

setCloningEnabled

public void setCloningEnabled(boolean cloningEnable)
Sets cloning on region

Parameters:
cloningEnable -
Since:
6.1
See Also:
RegionAttributes.getCloningEnabled()

setPoolName

public void setPoolName(String name)
Sets the pool name attribute. This causes regions that use these attributes to be a client region which communicates with the servers that the connection pool communicates with.

If this attribute is set to null or "" then the connection pool is disabled causing regions that use these attributes to be communicate with peers instead of servers.

The named connection pool must exist on the cache at the time these attributes are used to create a region. See PoolManager.createFactory() for how to create a connection pool.

Parameters:
name - the name of the connection pool to use; if null or "" then the connection pool is disabled for regions using these attributes.
Throws:
IllegalStateException - if a cache loader or cache writer has already been set.
Since:
5.7

createRegionAttributes

@Deprecated
public RegionAttributes<K,V> createRegionAttributes()
Deprecated. as of GemFire 5.0, use create() instead

Creates a RegionAttributes with the current settings.

Returns:
the newly created RegionAttributes
Throws:
IllegalStateException - if the current settings violate the compatibility rules

create

public RegionAttributes<K,V> create()
Creates a RegionAttributes with the current settings.

Returns:
the newly created RegionAttributes
Throws:
IllegalStateException - if the current settings violate the compatibility rules
Since:
5.0

validateAttributes

public static void validateAttributes(RegionAttributes<?,?> attrs)
Validates that the attributes are consistent with each other. The following rules are checked and enforced:

Throws:
IllegalStateException - if the attributes are not consistent with each other.
Since:
3.5

GemFire 6.5.1.2

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.