Class MemoryPolicyConfiguration

  • All Implemented Interfaces:
    Serializable

    @Deprecated
    public final class MemoryPolicyConfiguration
    extends Object
    implements Serializable
    Deprecated.
    This class allows defining custom memory policies' configurations with various parameters for Apache Ignite page memory (see 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>
         
     
    See Also:
    Serialized Form
    • Constructor Detail

      • MemoryPolicyConfiguration

        public MemoryPolicyConfiguration()
        Deprecated.
    • Method Detail

      • getName

        public String getName()
        Deprecated.
        Gets memory policy name.
        Returns:
        Memory policy name.
      • getMaxSize

        public long getMaxSize()
        Deprecated.
        Maximum memory region size defined by this memory policy. If the whole data can not fit into the memory region an out of memory exception will be thrown.
        Returns:
        Size in bytes.
      • setMaxSize

        public MemoryPolicyConfiguration setMaxSize​(long maxSize)
        Deprecated.
        Sets maximum memory region size defined by this memory policy. The total size should not be less than 10 MB due to the internal data structures overhead.
        Parameters:
        maxSize - Maximum memory policy size in bytes.
        Returns:
        this for chaining.
      • getInitialSize

        public long getInitialSize()
        Deprecated.
        Gets initial memory region size defined by this memory policy. When the used memory size exceeds this value, new chunks of memory will be allocated.
        Returns:
        Memory policy start size.
      • setInitialSize

        public MemoryPolicyConfiguration setInitialSize​(long initialSize)
        Deprecated.
        Sets initial memory region size defined by this memory policy. When the used memory size exceeds this value, new chunks of memory will be allocated.
        Parameters:
        initialSize - Memory policy initial size.
        Returns:
        this for chaining.
      • getSwapFilePath

        public String getSwapFilePath()
        Deprecated.
        A path to the memory-mapped files the memory region defined by this memory policy will be mapped to. Having the path set, allows relying on swapping capabilities of an underlying operating system for the memory region.
        Returns:
        A path to the memory-mapped files or null if this feature is not used for the memory region defined by this memory policy.
      • setSwapFilePath

        public MemoryPolicyConfiguration setSwapFilePath​(String swapFilePath)
        Deprecated.
        Sets a path to the memory-mapped file.
        Parameters:
        swapFilePath - A Path to the memory mapped file.
        Returns:
        this for chaining.
      • setPageEvictionMode

        public MemoryPolicyConfiguration setPageEvictionMode​(DataPageEvictionMode evictionMode)
        Deprecated.
        Sets memory pages eviction mode.
        Parameters:
        evictionMode - Eviction mode.
        Returns:
        this for chaining.
      • getEvictionThreshold

        public double getEvictionThreshold()
        Deprecated.
        Gets a threshold for memory pages eviction initiation. For instance, if the threshold is 0.9 it means that the page memory will start the eviction only after 90% of the memory region (defined by this policy) is occupied.
        Returns:
        Memory pages eviction threshold.
      • setEvictionThreshold

        public MemoryPolicyConfiguration setEvictionThreshold​(double evictionThreshold)
        Deprecated.
        Sets memory pages eviction threshold.
        Parameters:
        evictionThreshold - Eviction threshold.
        Returns:
        this for chaining.
      • getEmptyPagesPoolSize

        public int getEmptyPagesPoolSize()
        Deprecated.
        Specifies the minimal number of empty pages to be present in reuse lists for this memory policy. This parameter ensures that Ignite will be able to successfully evict old data entries when the size of (key, value) pair is slightly larger than page size / 2. Increase this parameter if cache can contain very big entries (total size of pages in this pool should be enough to contain largest cache entry). Increase this parameter if IgniteOutOfMemoryException occurred with enabled page eviction.
        Returns:
        Minimum number of empty pages in reuse list.
      • setEmptyPagesPoolSize

        public MemoryPolicyConfiguration setEmptyPagesPoolSize​(int emptyPagesPoolSize)
        Deprecated.
        Specifies the minimal number of empty pages to be present in reuse lists for this memory policy. This parameter ensures that Ignite will be able to successfully evict old data entries when the size of (key, value) pair is slightly larger than page size / 2. Increase this parameter if cache can contain very big entries (total size of pages in this pool should be enough to contain largest cache entry). Increase this parameter if IgniteOutOfMemoryException occurred with enabled page eviction.
        Parameters:
        emptyPagesPoolSize - Empty pages pool size.
        Returns:
        this for chaining.
      • isMetricsEnabled

        public boolean isMetricsEnabled()
        Deprecated.
        Gets whether memory metrics are enabled by default on node startup.
        Returns:
        Metrics enabled flag.
      • setMetricsEnabled

        public MemoryPolicyConfiguration setMetricsEnabled​(boolean metricsEnabled)
        Deprecated.
        Sets memory metrics enabled flag. If this flag is true, metrics will be enabled on node startup.
        Parameters:
        metricsEnabled - Metrics enabled flag.
        Returns:
        this for chaining.