|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gemstone.gemfire.cache.EvictionAttributes
public abstract class EvictionAttributes
Attributes that describe how a Region's size is managed
through an eviction controller. Eviction controllers are defined by an
EvictionAlgorithm and a
EvictionAction. Once a
Region is created with an eviction controller, it can not be removed,
however it can be changed through an
EvictionAttributesMutator.
AttributesFactory.setEvictionAttributes(EvictionAttributes),
AttributesMutator,
Serialized Form| Constructor Summary | |
|---|---|
EvictionAttributes()
|
|
| Method Summary | |
|---|---|
static EvictionAttributes |
createLIFOEntryAttributes(int maximumEntries,
EvictionAction evictionAction)
Convenience method for LIFOCapacityController |
static EvictionAttributes |
createLIFOMemoryAttributes(int maximumMegabytes,
EvictionAction evictionAction)
Convenience method for MemLIFOCapacityController |
static EvictionAttributes |
createLRUEntryAttributes()
Convenience method to replace instantiation of an LRUCapacityController. |
static EvictionAttributes |
createLRUEntryAttributes(int maximumEntries)
Convenience method for LRUCapacityController |
static EvictionAttributes |
createLRUEntryAttributes(int maximumEntries,
EvictionAction evictionAction)
Convenience method for LRUCapacityController |
static EvictionAttributes |
createLRUHeapAttributes()
Convenience method to replace the HeapLRUCapacityController Creates EvictionAttributes for an eviction controller which removes Entries based on the percentage of Java VM heap memory that is currently being used. |
static EvictionAttributes |
createLRUHeapAttributes(int heapPercentage)
Convenience method for HeapLRUCapacityController |
static EvictionAttributes |
createLRUHeapAttributes(int heapPercentage,
int evictorInterval,
EvictionAction evictionAction)
Convenience method for HeapLRUCapacityController |
static EvictionAttributes |
createLRUMemoryAttributes()
Convenience method for MemLRUCapacityController Creates EvictionAttributes for an eviction controller that will remove the least recently used (LRU) entry from a region once the region reaches a certain byte capacity. |
static EvictionAttributes |
createLRUMemoryAttributes(int maximumMegabytes)
Convenience method for eviction of MemLRUCapacityController |
static EvictionAttributes |
createLRUMemoryAttributes(int maximumMegabytes,
ObjectSizer sizer)
Convenience method for MemLRUCapacityController |
static EvictionAttributes |
createLRUMemoryAttributes(int maximumMegabytes,
ObjectSizer sizer,
EvictionAction evictionAction)
Convenience method for MemLRUCapacityController |
boolean |
equals(Object obj)
|
abstract EvictionAction |
getAction()
|
abstract EvictionAlgorithm |
getAlgorithm()
The algorithm is used to identify entries that will be evicited. |
abstract long |
getInterval()
The interval is used by the EvictionAlgorithm.LRU_HEAP algorithm to
determine when to check the JVM heap. |
abstract int |
getMaximum()
The unit of this value is determined by the definition of the EvictionAlgorithm set by one of the creation methods e.g. |
abstract ObjectSizer |
getObjectSizer()
An ObjectSizer is used by the EvictionAlgorithm.LRU_MEMORY
algorithm to measure the size of each Entry as it is entered into a Region. |
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EvictionAttributes()
| Method Detail |
|---|
public static final EvictionAttributes createLRUEntryAttributes()
Convenience method to replace instantiation of an LRUCapacityController.
Creates the EvictionAttributes for an eviction controller that will remove
the least recently used (LRU) entry from a region once the region reaches a
certain capacity. The entry is locally destroyed when evicted by the
eviction controller.
This is not supported when mirroring is enabled.
If you are using a cache.xml file to create a Cache Region
declaratively, you can include the following to create an LRU entry
eviction controller
<region-attributes>
<eviction-attributes>
<lru-entry-count maximum="1000" action="overflow-to-disk"/>
</eviction-attributes>
</region-attributes>
public static final EvictionAttributes createLRUEntryAttributes(int maximumEntries)
createLRUEntryAttributes()
public static final EvictionAttributes createLRUEntryAttributes(int maximumEntries,
EvictionAction evictionAction)
createLRUEntryAttributes()public static final EvictionAttributes createLRUHeapAttributes()
Convenience method to replace the HeapLRUCapacityController
Creates EvictionAttributes for an eviction controller which removes Entries based on the percentage of Java VM heap memory that is currently being used. If the percentage of Java VM heap memory in use exceeds the given percentage, then the least recently used entry of the region is evicted.
With other LRU-based eviction controllers only cache actions (such as
puts and gets) cause the LRU entry
to be evicted. However, because the JVM's heap may be effected by more than
just the GemFire cache, a daemon thread (the "evictor thread")
periodically, based on the evictorInterval, evicts the LRU entry (and
write pending data to disk to free up heap
space) if the percentage of VM heap being used exceeds the threshold.
GemStone has found that a heap based eviction controller has the most
effect on a VM that is lauched with both the -Xmx and
-Xms switches used. Many virtual machine implementations
have additional VM switches to control the behavior of the garbage
collector. We suggest that you investigate tuning the garbage collector
when using this type of eviction controller. In particular, we have found
improved behavior when running with Sun's HotSpot VM, the
-XX:+UseConcMarkSweepGC and -XX:+UseParNewGC
options.
If you are using a cache.xml file to create a Cache Region
declaratively, you can include the following to create an LRU heap eviction
controller:
<region-attributes>
<eviction-attributes>
<lru-heap-percentage maximum="90" action="overflow-to-disk" interval="200"/>
</eviction-attributes>
</region-attributes>
public static final EvictionAttributes createLRUHeapAttributes(int heapPercentage)
createLRUHeapAttributes()
public static final EvictionAttributes createLRUHeapAttributes(int heapPercentage,
int evictorInterval,
EvictionAction evictionAction)
createLRUHeapAttributes()public static final EvictionAttributes createLRUMemoryAttributes()
Convenience method for MemLRUCapacityController
Creates EvictionAttributes for an eviction controller that will remove
the least recently used (LRU) entry from a region once the region reaches a
certain byte capacity. Capacity is determined by monitoring the size of
entries added and evicted. Capacity is specified in terms of megabytes.
GemFire uses an effcient algorithm to determine the amount of space a
region entry occupies in the VM. However, this algorithm may not yield
optimal results for all kinds of data. The user may provide his or her own
algorithm for determining the size of objects by implementing an
ObjectSizer.
If you are using a cache.xml file to create a Cache Region
declaratively, you can include the following to create an LRU memory
eviction controller:
<region-attributes>
<eviction-attributes>
<lru-memory-size maximum="1000" action="overflow-to-disk">
<class-name>com.foo.MySizer</class-name>
<parameter name="name">
<string>Super Sizer</string>
</parameter>
</lru-memory-size>
</eviction-attributes>
</region-attributes>
public static final EvictionAttributes createLRUMemoryAttributes(int maximumMegabytes)
createLRUMemoryAttributes()
public static final EvictionAttributes createLRUMemoryAttributes(int maximumMegabytes,
ObjectSizer sizer)
createLRUMemoryAttributes()
public static final EvictionAttributes createLRUMemoryAttributes(int maximumMegabytes,
ObjectSizer sizer,
EvictionAction evictionAction)
createLRUMemoryAttributes()public abstract ObjectSizer getObjectSizer()
ObjectSizer is used by the EvictionAlgorithm.LRU_MEMORY
algorithm to measure the size of each Entry as it is entered into a Region.
A default implementation is provided, see
createLRUMemoryAttributes() for more.
EvictionAlgorithm.LRU_MEMORY, for all
algorithms null is returned.public abstract long getInterval()
EvictionAlgorithm.LRU_HEAP algorithm to
determine when to check the JVM heap.
EvictionAlgorithm than EvictionAlgorithm.LRU_HEAP
is used.public abstract EvictionAlgorithm getAlgorithm()
public abstract int getMaximum()
EvictionAlgorithm set by one of the creation methods e.g.
createLRUEntryAttributes()
EvictionAlgorithm which
determines when the EvictionAction is performed.public abstract EvictionAction getAction()
EvictionAlgorithm takes when the maximum
value is reached.public final boolean equals(Object obj)
equals in class Objectpublic final int hashCode()
hashCode in class Objectpublic final String toString()
toString in class Object
public static final EvictionAttributes createLIFOEntryAttributes(int maximumEntries,
EvictionAction evictionAction)
public static final EvictionAttributes createLIFOMemoryAttributes(int maximumMegabytes,
EvictionAction evictionAction)
|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||