Gemfire JavaDocs_test
Package org.apache.geode.cache
Class DataPolicy
- java.lang.Object
-
- org.apache.geode.cache.DataPolicy
-
- All Implemented Interfaces:
java.io.Serializable
@Immutable public class DataPolicy extends java.lang.Object implements java.io.Serializable
Enumerated type for region data policy. The data policy specifies how this local cache will handle the data for a region.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 inPartitionAttributes
with aPartitionAttributesFactory
.PERSISTENT_PARTITION
in addition toPARTITION
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 asNORMAL
.PERSISTENT_REPLICATE
in addition toREPLICATE
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.
- Since:
- GemFire 5.0
- See Also:
AttributesFactory.setDataPolicy(org.apache.geode.cache.DataPolicy)
,RegionAttributes.getDataPolicy()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static DataPolicy
DEFAULT
The data policy used by default; it isNORMAL
.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.useordinal()
static DataPolicy
PARTITION
Data in this region may be spread across a number of processes.static DataPolicy
PERSISTENT_PARTITION
In addition toPARTITION
also causes data to be stored to disk.static DataPolicy
PERSISTENT_REPLICATE
In addition toREPLICATE
also causes data to be stored to disk.static DataPolicy
PRELOADED
In addition toNORMAL
, 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DataPolicy
fromOrdinal(byte ordinal)
Return the DataPolicy represented by specified ordinalstatic DataPolicy
fromString(java.lang.String s)
Deprecated.usevalueOf(String)
boolean
isDefault()
Deprecated.from version 6.5 forward please use an identity comparison instead of this methodboolean
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 methodboolean
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()
java.lang.String
toString()
Returns a string representation for this data policy.static DataPolicy
valueOf(java.lang.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.
-
-
-
Field Detail
-
EMPTY
@Immutable public static final DataPolicy EMPTY
Data is never stored in local memory. The region will always be empty locally. 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
@Immutable public static final DataPolicy NORMAL
Allows the contents in this cache to differ from other caches.Data that this region is interested in is stored in local memory.
-
REPLICATE
@Immutable public static final DataPolicy REPLICATE
The region will be initialized with the data from other caches and accepts any new entries created in other caches.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.
-
PERSISTENT_REPLICATE
@Immutable public static final DataPolicy PERSISTENT_REPLICATE
In addition toREPLICATE
also causes data to be stored to disk. The region initialization may use the data stored on disk.
-
PARTITION
@Immutable public static final DataPolicy PARTITION
Data in this region may be spread across a number of processes. This is further configured withpartitioning attributes
-
PRELOADED
@Immutable public static final DataPolicy PRELOADED
In addition toNORMAL
, contents inside of this cache are (partially) initialized with data from other caches, if available.
-
PERSISTENT_PARTITION
@Immutable public static final DataPolicy PERSISTENT_PARTITION
In addition toPARTITION
also causes data to be stored to disk. The region initialization may use the data stored on disk.- Since:
- GemFire 6.5
-
DEFAULT
@Immutable public static final DataPolicy DEFAULT
The data policy used by default; it isNORMAL
.
-
ordinal
@Deprecated public final byte ordinal
Deprecated.useordinal()
Used as ordinal to represent this DataPolicy
-
-
Method Detail
-
ordinal
public int ordinal()
- Returns:
- ordinal value.
-
valueOf
public static DataPolicy valueOf(java.lang.String name) throws java.lang.IllegalArgumentException
Get enum value by name.- Parameters:
name
- of enum value.- Returns:
- enum by name.
- Throws:
java.lang.IllegalArgumentException
- if the specified enum type has no constant with the specified name.java.lang.NullPointerException
- if name is null.
-
fromOrdinal
public static DataPolicy fromOrdinal(byte ordinal)
Return the DataPolicy represented by specified ordinal- Parameters:
ordinal
- the ordinal representation of a DataPolicy- Returns:
- the DataPolicy represented by specified ordinal
-
withStorage
public boolean withStorage()
Return true if regions with this policy store data locally.Although DataPolicy
PARTITION
will return true to this query, it is possible to turn off local storage withPartitionAttributesFactory.setLocalMaxMemory(int)
by setting localMaxMemory to zero.- Returns:
- true if regions with this policy store data locally.
- See Also:
NORMAL
,PRELOADED
,REPLICATE
,PERSISTENT_REPLICATE
,PARTITION
,PERSISTENT_PARTITION
-
withReplication
public boolean withReplication()
Return whether this policy does replication.- Returns:
- true if this policy does replication.
- See Also:
REPLICATE
,PERSISTENT_REPLICATE
-
withPersistence
public boolean withPersistence()
Return whether this policy does persistence.- Returns:
- true if this policy does persistence.
- Since:
- GemFire 6.5
- See Also:
PERSISTENT_PARTITION
,PERSISTENT_REPLICATE
-
withPartitioning
public boolean withPartitioning()
Return whether this policy does partitioning.- Returns:
- true if this policy does partitioning
- Since:
- GemFire 6.5
- See Also:
PARTITION
,PERSISTENT_PARTITION
-
withPreloaded
public boolean withPreloaded()
Return whether this policy does preloaded.- Returns:
- true if this policy does preloaded.
- Since:
- GemFire 6.5
- See Also:
PRELOADED
-
isEmpty
@Deprecated public boolean isEmpty()
Deprecated.from version 6.5 forward please use withStorage()Return true if this policy isEMPTY
.- Returns:
- true if this policy is
EMPTY
.
-
isNormal
@Deprecated public boolean isNormal()
Deprecated.from version 6.5 forward please use an identity comparison instead of this methodReturn true if this policy isNORMAL
.- Returns:
- true if this policy is
NORMAL
.
-
isPreloaded
@Deprecated public boolean isPreloaded()
Deprecated.from version 6.5 forward please use withPreloaded()Return true if this policy isPRELOADED
.- Returns:
- true if this policy is
PRELOADED
-
isDefault
@Deprecated public boolean isDefault()
Deprecated.from version 6.5 forward please use an identity comparison instead of this methodReturn true if this policy is the default.- Returns:
- true if this policy is the default.
-
isReplicate
@Deprecated public boolean isReplicate()
Deprecated.from version 6.5 forward please use withReplication()Return true if this policy isREPLICATE
.- Returns:
- true if this policy is
REPLICATE
.
-
isPersistentReplicate
@Deprecated public boolean isPersistentReplicate()
Deprecated.from version 6.5 forward please use withPersistence() and withReplication()Return true if this policy isPERSISTENT_REPLICATE
.- Returns:
- true if this policy is
PERSISTENT_REPLICATE
.
-
isPartition
@Deprecated public boolean isPartition()
Deprecated.from version 6.5 forward please use withPartitioning()Return true if this policy isPARTITION
.- Returns:
- true if this policy is
PARTITION
-
toString
public java.lang.String toString()
Returns a string representation for this data policy.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the name of this data policy.
-
fromString
@Deprecated public static DataPolicy fromString(java.lang.String s)
Deprecated.usevalueOf(String)
- Parameters:
s
- a String representation of a DataPolicy- Returns:
- a DataPolicy
-
-