Class EvictionConfig

    • Field Detail

      • DEFAULT_MAX_ENTRY_COUNT

        public static final int DEFAULT_MAX_ENTRY_COUNT
        Default maximum entry count.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_SIZE_POLICY

        public static final MaxSizePolicy DEFAULT_MAX_SIZE_POLICY
        Default Max-Size Policy.
      • DEFAULT_EVICTION_POLICY

        public static final EvictionPolicy DEFAULT_EVICTION_POLICY
        Default Eviction Policy.
      • size

        protected int size
      • comparatorClassName

        protected java.lang.String comparatorClassName
    • Constructor Detail

      • EvictionConfig

        public EvictionConfig()
    • Method Detail

      • getSize

        public int getSize()
        Returns the size which is used by the MaxSizePolicy.

        The interpretation of the value depends on the configured MaxSizePolicy.

        Returns:
        the size which is used by the MaxSizePolicy
      • setSize

        public EvictionConfig setSize​(int size)
        Sets the size which is used by the MaxSizePolicy.

        The interpretation of the value depends on the configured MaxSizePolicy.

        Accepts any non-negative number. The default value is 10000.

        Parameters:
        size - the size which is used by the MaxSizePolicy
        Returns:
        this EvictionConfig instance
      • getEvictionPolicy

        public EvictionPolicy getEvictionPolicy()
        Returns the EvictionPolicy of this eviction configuration.
        Specified by:
        getEvictionPolicy in interface com.hazelcast.internal.eviction.EvictionConfiguration
        Returns:
        the EvictionPolicy of this eviction configuration
      • getEvictionStrategyType

        public com.hazelcast.internal.eviction.EvictionStrategyType getEvictionStrategyType()
        Returns the EvictionStrategyType of this eviction configuration.
        Specified by:
        getEvictionStrategyType in interface com.hazelcast.internal.eviction.EvictionConfiguration
        Returns:
        the EvictionStrategyType of this eviction configuration
      • getComparatorClassName

        public java.lang.String getComparatorClassName()
        Returns the class name of the configured EvictionPolicyComparator implementation.
        Specified by:
        getComparatorClassName in interface com.hazelcast.internal.eviction.EvictionConfiguration
        Returns:
        the class name of the configured EvictionPolicyComparator implementation
      • setComparatorClassName

        public EvictionConfig setComparatorClassName​(@Nonnull
                                                     java.lang.String comparatorClassName)
        Sets the class name of the configured EvictionPolicyComparator implementation.

        Only one of the comparator class name and comparator can be configured in the eviction configuration.

        Parameters:
        comparatorClassName - the class name of the configured EvictionPolicyComparator implementation
        Returns:
        this EvictionConfig instance
      • writeData

        public void writeData​(ObjectDataOutput out)
                       throws java.io.IOException
        Description copied from interface: DataSerializable
        Writes object fields to output stream
        Specified by:
        writeData in interface DataSerializable
        Parameters:
        out - output
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
      • readData

        public void readData​(ObjectDataInput in)
                      throws java.io.IOException
        Description copied from interface: DataSerializable
        Reads fields from the input stream
        Specified by:
        readData in interface DataSerializable
        Parameters:
        in - input
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object