Class ContainerMemoryConfigurationBuilder

java.lang.Object
org.infinispan.configuration.global.AbstractGlobalConfigurationBuilder
org.infinispan.configuration.global.ContainerMemoryConfigurationBuilder
All Implemented Interfaces:
Builder<ContainerMemoryConfiguration>, GlobalConfigurationChildBuilder

public class ContainerMemoryConfigurationBuilder extends AbstractGlobalConfigurationBuilder implements Builder<ContainerMemoryConfiguration>
Configures the container memory which allows for a shared memory space used by multiple caches that can be bounded so when the limit is surpassed an entry is evicted to ensure memory does not grow too much. The memory container supports both count based (number of entries) and size based (how much approximate memory in bytes) eviction methods.
Since:
16.1
Author:
William Burns
  • Method Details

    • attributes

      public AttributeSet attributes()
      Specified by:
      attributes in interface Builder<ContainerMemoryConfiguration>
    • maxSize

      Defines the maximum size of the container memory.
      Parameters:
      size - The size of the memory container in bytes. This can be a number or a string ending with KB, MB, GB, TB, PB (e.g. "10MB").
      Returns:
      this, for method chaining
    • maxSize

      public String maxSize()
      The currently configured max size.
      Returns:
      The size as a string.
    • maxCount

      public ContainerMemoryConfigurationBuilder maxCount(long count)
      Defines the maximum number of entries for the container memory.
      Parameters:
      count - The maximum number of entries.
      Returns:
      this, for method chaining
    • maxCount

      public long maxCount()
      The currently configured max count.
      Returns:
      The maximum number of entries.
    • dynamicResize

      public ContainerMemoryConfigurationBuilder dynamicResize(boolean dynamicResize)
      Enables dynamic resizing of this container based on JVM memory pressure. Requires the memory-monitor to be enabled.
      Parameters:
      dynamicResize - whether to enable dynamic resizing
      Returns:
      this, for method chaining
    • dynamicResize

      public boolean dynamicResize()
      Whether dynamic resizing is currently enabled.
    • validate

      public void validate()
      Description copied from interface: Builder
      Validate the data in this builder before building the configuration bean
      Specified by:
      validate in interface Builder<ContainerMemoryConfiguration>
    • create

      Description copied from interface: Builder
      Create the configuration bean
      Specified by:
      create in interface Builder<ContainerMemoryConfiguration>
      Returns:
    • read

      Description copied from interface: Builder
      Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration
      Specified by:
      read in interface Builder<ContainerMemoryConfiguration>
      Parameters:
      template - the configuration from which to "clone" this config if needed.
      combine - the way attributes and children of this instance and the template should be combined.
    • toString

      public String toString()
      Overrides:
      toString in class Object