@Immutable public class DataPolicy extends Object implements Serializable
EMPTY
causes data to never be stored in local memory. The region will always
appear empty. It can be used to for zero footprint producers that only want to distribute their
data to others and for zero footprint consumers that only want to see events.
NORMAL
causes data that this region is interested in to be stored in local
memory. It allows the contents in this cache to differ from other caches.
PARTITION
causes data that this region holds to be spread across processes. The
amount of data held in this cache is configured in PartitionAttributes
with a
PartitionAttributesFactory
.
PERSISTENT_PARTITION
in addition to PARTITION
also causes data to
be stored to disk. The region initialization uses the data stored on disk.
REPLICATE
causes data that this region is interested in to be stored in local
memory. A distributed region will be initialized with the data from other caches. On distributed
region operations that would cause the contents to differ with other caches are not allowed. This
policy is allowed on local scope region but it behaves the same as NORMAL
.
PERSISTENT_REPLICATE
in addition to REPLICATE
also causes data to
be stored to disk. The region initialization uses the data stored on disk. Note that the
persistence applies to both local scope and distributed scope.
AttributesFactory.setDataPolicy(org.apache.geode.cache.DataPolicy)
,
RegionAttributes.getDataPolicy()
,
Serialized FormModifier and Type | Field and Description |
---|---|
static DataPolicy |
DEFAULT
The data policy used by default; it is
NORMAL . |
static DataPolicy |
EMPTY
Data is never stored in local memory.
|
static DataPolicy |
NORMAL
Allows the contents in this cache to differ from other caches.
|
byte |
ordinal
Deprecated.
use
ordinal() |
static DataPolicy |
PARTITION
Data in this region may be spread across a number of processes.
|
static DataPolicy |
PERSISTENT_PARTITION
In addition to
PARTITION also causes data to be stored to disk. |
static DataPolicy |
PERSISTENT_REPLICATE
In addition to
REPLICATE also causes data to be stored to disk. |
static DataPolicy |
PRELOADED
In addition to
NORMAL , contents inside of this cache are (partially) initialized
with data from other caches, if available. |
static DataPolicy |
REPLICATE
The region will be initialized with the data from other caches and accepts any new entries
created in other caches.
|
Modifier and Type | Method and Description |
---|---|
static DataPolicy |
fromOrdinal(byte ordinal)
Return the DataPolicy represented by specified ordinal
|
static DataPolicy |
fromString(String s)
Deprecated.
use
valueOf(String) |
boolean |
isDefault()
Deprecated.
from version 6.5 forward please use an identity comparison instead of this method
|
boolean |
isEmpty()
Deprecated.
from version 6.5 forward please use withStorage()
|
boolean |
isNormal()
Deprecated.
from version 6.5 forward please use an identity comparison instead of this method
|
boolean |
isPartition()
Deprecated.
from version 6.5 forward please use withPartitioning()
|
boolean |
isPersistentReplicate()
Deprecated.
from version 6.5 forward please use withPersistence() and withReplication()
|
boolean |
isPreloaded()
Deprecated.
from version 6.5 forward please use withPreloaded()
|
boolean |
isReplicate()
Deprecated.
from version 6.5 forward please use withReplication()
|
int |
ordinal() |
String |
toString()
Returns a string representation for this data policy.
|
static DataPolicy |
valueOf(String name)
Get enum value by name.
|
boolean |
withPartitioning()
Return whether this policy does partitioning.
|
boolean |
withPersistence()
Return whether this policy does persistence.
|
boolean |
withPreloaded()
Return whether this policy does preloaded.
|
boolean |
withReplication()
Return whether this policy does replication.
|
boolean |
withStorage()
Return true if regions with this policy store data locally.
|
@Immutable public static final DataPolicy EMPTY
@Immutable public static final DataPolicy NORMAL
Data that this region is interested in is stored in local memory.
@Immutable public static final DataPolicy REPLICATE
Operations that would cause the contents to differ with other caches are not allowed.
Data that this region is interested in is stored in local memory.
@Immutable public static final DataPolicy PERSISTENT_REPLICATE
REPLICATE
also causes data to be stored to disk. The region
initialization may use the data stored on disk.@Immutable public static final DataPolicy PARTITION
partitioning attributes
@Immutable public static final DataPolicy PRELOADED
NORMAL
, contents inside of this cache are (partially) initialized
with data from other caches, if available.@Immutable public static final DataPolicy PERSISTENT_PARTITION
PARTITION
also causes data to be stored to disk. The region
initialization may use the data stored on disk.@Immutable public static final DataPolicy DEFAULT
NORMAL
.@Deprecated public final byte ordinal
ordinal()
public int ordinal()
public static DataPolicy valueOf(String name) throws IllegalArgumentException
name
- of enum value.IllegalArgumentException
- if the specified enum type has no constant with the specified
name.NullPointerException
- if name is null.public static DataPolicy fromOrdinal(byte ordinal)
ordinal
- the ordinal representation of a DataPolicypublic boolean withStorage()
Although DataPolicy PARTITION
will return true to this query, it is possible to turn
off local storage with PartitionAttributesFactory.setLocalMaxMemory(int)
by setting
localMaxMemory to zero.
NORMAL
,
PRELOADED
,
REPLICATE
,
PERSISTENT_REPLICATE
,
PARTITION
,
PERSISTENT_PARTITION
public boolean withReplication()
REPLICATE
,
PERSISTENT_REPLICATE
public boolean withPersistence()
PERSISTENT_PARTITION
,
PERSISTENT_REPLICATE
public boolean withPartitioning()
PARTITION
,
PERSISTENT_PARTITION
public boolean withPreloaded()
PRELOADED
@Deprecated public boolean isEmpty()
EMPTY
.EMPTY
.@Deprecated public boolean isNormal()
NORMAL
.NORMAL
.@Deprecated public boolean isPreloaded()
PRELOADED
.PRELOADED
@Deprecated public boolean isDefault()
@Deprecated public boolean isReplicate()
REPLICATE
.REPLICATE
.@Deprecated public boolean isPersistentReplicate()
PERSISTENT_REPLICATE
.PERSISTENT_REPLICATE
.@Deprecated public boolean isPartition()
PARTITION
.PARTITION
public String toString()
@Deprecated public static DataPolicy fromString(String s)
valueOf(String)
s
- a String representation of a DataPolicy