DataRegionConfiguration
instead.@Deprecated public final class MemoryPolicyConfiguration extends Object implements Serializable
MemoryConfiguration
. For each configured memory policy Apache Ignite instantiates
respective memory regions with different parameters like maximum size, eviction policy, swapping options, etc.
An Apache Ignite cache can be mapped to a particular policy using
CacheConfiguration.setMemoryPolicyName(String)
method.
Sample configuration below shows how to configure several memory policies:
<property name="memoryConfiguration">
<bean class="org.apache.ignite.configuration.MemoryConfiguration">
<property name="defaultMemoryPolicyName" value="Default_Region"/>
<property name="pageSize" value="4096"/>
<property name="memoryPolicies">
<list>
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
<property name="name" value="Default_Region"/>
<property name="initialSize" value="#{100L * 1024 * 1024}"/>
</bean>
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
<property name="name" value="20MB_Region_Eviction"/>
<property name="initialSize" value="#{20L * 1024 * 1024}"/>
<property name="pageEvictionMode" value="RANDOM_2_LRU"/>
</bean>
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
<property name="name" value="25MB_Region_Swapping"/>
<property name="initialSize" value="#{25L * 1024 * 1024}"/>
<property name="maxSize" value="#{100L * 1024 * 1024}"/>
<property name="swapFilePath" value="memoryPolicyExampleSwap"/>
</bean>
</list>
</property>
Modifier and Type | Field and Description |
---|---|
static boolean |
DFLT_METRICS_ENABLED
Deprecated.
Default metrics enabled flag.
|
static int |
DFLT_RATE_TIME_INTERVAL_MILLIS
Deprecated.
Default length of interval over which
MemoryMetrics.getAllocationRate() metric is calculated. |
static int |
DFLT_SUB_INTERVALS
Deprecated.
Default amount of sub intervals to calculate
MemoryMetrics.getAllocationRate() metric. |
Constructor and Description |
---|
MemoryPolicyConfiguration()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
getEmptyPagesPoolSize()
Deprecated.
Specifies the minimal number of empty pages to be present in reuse lists for this memory policy.
|
double |
getEvictionThreshold()
Deprecated.
Gets a threshold for memory pages eviction initiation.
|
long |
getInitialSize()
Deprecated.
Gets initial memory region size defined by this memory policy.
|
long |
getMaxSize()
Deprecated.
Maximum memory region size defined by this memory policy.
|
String |
getName()
Deprecated.
Gets memory policy name.
|
DataPageEvictionMode |
getPageEvictionMode()
Deprecated.
Gets memory pages eviction mode.
|
long |
getRateTimeInterval()
Deprecated.
Use
MetricsMxBean.configureHitRateMetric(String, long) instead. |
int |
getSubIntervals()
Deprecated.
Use
MetricsMxBean.configureHitRateMetric(String, long) instead. |
String |
getSwapFilePath()
Deprecated.
A path to the memory-mapped files the memory region defined by this memory policy will be mapped to.
|
boolean |
isMetricsEnabled()
Deprecated.
Gets whether memory metrics are enabled by default on node startup.
|
MemoryPolicyConfiguration |
setEmptyPagesPoolSize(int emptyPagesPoolSize)
Deprecated.
Specifies the minimal number of empty pages to be present in reuse lists for this memory policy.
|
MemoryPolicyConfiguration |
setEvictionThreshold(double evictionThreshold)
Deprecated.
Sets memory pages eviction threshold.
|
MemoryPolicyConfiguration |
setInitialSize(long initialSize)
Deprecated.
Sets initial memory region size defined by this memory policy.
|
MemoryPolicyConfiguration |
setMaxSize(long maxSize)
Deprecated.
Sets maximum memory region size defined by this memory policy.
|
MemoryPolicyConfiguration |
setMetricsEnabled(boolean metricsEnabled)
Deprecated.
Sets memory metrics enabled flag.
|
MemoryPolicyConfiguration |
setName(String name)
Deprecated.
Sets memory policy name.
|
MemoryPolicyConfiguration |
setPageEvictionMode(DataPageEvictionMode evictionMode)
Deprecated.
Sets memory pages eviction mode.
|
MemoryPolicyConfiguration |
setRateTimeInterval(long rateTimeInterval)
Deprecated.
Use
MetricsMxBean.configureHitRateMetric(String, long) instead. |
MemoryPolicyConfiguration |
setSubIntervals(int subIntervals)
Deprecated.
Use
MetricsMxBean.configureHitRateMetric(String, long) instead. |
MemoryPolicyConfiguration |
setSwapFilePath(String swapFilePath)
Deprecated.
Sets a path to the memory-mapped file.
|
String |
toString()
Deprecated.
|
public static final boolean DFLT_METRICS_ENABLED
public static final int DFLT_SUB_INTERVALS
MemoryMetrics.getAllocationRate()
metric.public static final int DFLT_RATE_TIME_INTERVAL_MILLIS
MemoryMetrics.getAllocationRate()
metric is calculated.public String getName()
public MemoryPolicyConfiguration setName(String name)
MemoryConfiguration.DFLT_MEM_PLC_DEFAULT_NAME
value is used.name
- Memory policy name.this
for chaining.public long getMaxSize()
public MemoryPolicyConfiguration setMaxSize(long maxSize)
maxSize
- Maximum memory policy size in bytes.this
for chaining.public long getInitialSize()
public MemoryPolicyConfiguration setInitialSize(long initialSize)
initialSize
- Memory policy initial size.this
for chaining.public String getSwapFilePath()
null
if this feature is not used for the memory region
defined by this memory policy.public MemoryPolicyConfiguration setSwapFilePath(String swapFilePath)
swapFilePath
- A Path to the memory mapped file.this
for chaining.public DataPageEvictionMode getPageEvictionMode()
DataPageEvictionMode.DISABLED
is used (default) then an out of
memory exception will be thrown if the memory region usage, defined by this memory policy, goes beyond its
capacity which is getMaxSize()
.DataPageEvictionMode.DISABLED
used by default.public MemoryPolicyConfiguration setPageEvictionMode(DataPageEvictionMode evictionMode)
evictionMode
- Eviction mode.this
for chaining.public double getEvictionThreshold()
public MemoryPolicyConfiguration setEvictionThreshold(double evictionThreshold)
evictionThreshold
- Eviction threshold.this
for chaining.public int getEmptyPagesPoolSize()
IgniteOutOfMemoryException
occurred with enabled page eviction.public MemoryPolicyConfiguration setEmptyPagesPoolSize(int emptyPagesPoolSize)
IgniteOutOfMemoryException
occurred with enabled page eviction.emptyPagesPoolSize
- Empty pages pool size.this
for chaining.public boolean isMetricsEnabled()
MX bean
.public MemoryPolicyConfiguration setMetricsEnabled(boolean metricsEnabled)
true
, metrics will be enabled on node startup.
Memory metrics can be enabled and disabled at runtime via memory metrics MX bean
.metricsEnabled
- Metrics enabled flag.this
for chaining.@Deprecated public long getRateTimeInterval()
MetricsMxBean.configureHitRateMetric(String, long)
instead.MemoryMetrics.getAllocationRate()
and MemoryMetrics.getEvictionRate()
monitoring purposes.
For instance, after setting the interval to 60_000 milliseconds,
subsequent calls to MemoryMetrics.getAllocationRate()
will return average allocation rate (pages per second) for the last minute.
@Deprecated public MemoryPolicyConfiguration setRateTimeInterval(long rateTimeInterval)
MetricsMxBean.configureHitRateMetric(String, long)
instead.MemoryMetrics.getAllocationRate()
and MemoryMetrics.getEvictionRate()
monitoring purposes.
For instance, after setting the interval to 60 seconds,
subsequent calls to MemoryMetrics.getAllocationRate()
will return average allocation rate (pages per second) for the last minute.
rateTimeInterval
- Time interval used for allocation and eviction rates calculations.this
for chaining.@Deprecated public int getSubIntervals()
MetricsMxBean.configureHitRateMetric(String, long)
instead.setRateTimeInterval(long)
will be split into to calculate MemoryMetrics.getAllocationRate()
and MemoryMetrics.getEvictionRate()
rates (5 by default).
Setting it to a bigger value will result in more precise calculation and smaller drops of
MemoryMetrics.getAllocationRate()
metric when next sub-interval has to be recycled but introduces bigger
calculation overhead.
@Deprecated public MemoryPolicyConfiguration setSubIntervals(int subIntervals)
MetricsMxBean.configureHitRateMetric(String, long)
instead.setRateTimeInterval(long)
will be split into to calculate
MemoryMetrics.getAllocationRate()
and MemoryMetrics.getEvictionRate()
rates (5 by default).
Setting it to a bigger value will result in more precise calculation and smaller drops of
MemoryMetrics.getAllocationRate()
metric when next sub-interval has to be recycled but introduces bigger
calculation overhead.
subIntervals
- A number of sub-intervals.this
for chaining.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024