com.hazelcast.config
Class CacheEvictionConfig

java.lang.Object
  extended by com.hazelcast.config.CacheEvictionConfig
All Implemented Interfaces:
EvictionConfig, DataSerializable, Serializable
Direct Known Subclasses:
CacheEvictionConfigReadOnly

public class CacheEvictionConfig
extends Object
implements EvictionConfig, DataSerializable, Serializable

Configuration for cache's capacity. You can set a limit for number of entries or total memory cost of entries.

See Also:
Serialized Form

Nested Class Summary
static class CacheEvictionConfig.CacheMaxSizePolicy
          Maximum Size Policy
 
Field Summary
static int DEFAULT_MAX_ENTRY_COUNT
          Default maximum entry count of cache.
 
Constructor Summary
CacheEvictionConfig()
           
CacheEvictionConfig(CacheEvictionConfig config)
           
CacheEvictionConfig(int size, CacheEvictionConfig.CacheMaxSizePolicy maxSizePolicy, EvictionPolicy evictionPolicy)
           
 
Method Summary
 CacheEvictionConfigReadOnly getAsReadOnly()
           
 EvictionPolicy getEvictionPolicy()
           
 EvictionPolicyType getEvictionPolicyType()
          Gets the type of eviction policy.
 EvictionStrategyType getEvictionStrategyType()
          Gets the type of eviction strategy.
 CacheEvictionConfig.CacheMaxSizePolicy getMaxSizePolicy()
           
 int getSize()
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 CacheEvictionConfig setEvictionPolicy(EvictionPolicy evictionPolicy)
           
 CacheEvictionConfig setMaxSizePolicy(CacheEvictionConfig.CacheMaxSizePolicy maxSizePolicy)
           
 CacheEvictionConfig setSize(int size)
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_ENTRY_COUNT

public static final int DEFAULT_MAX_ENTRY_COUNT
Default maximum entry count of cache.

See Also:
Constant Field Values
Constructor Detail

CacheEvictionConfig

public CacheEvictionConfig()

CacheEvictionConfig

public CacheEvictionConfig(int size,
                           CacheEvictionConfig.CacheMaxSizePolicy maxSizePolicy,
                           EvictionPolicy evictionPolicy)

CacheEvictionConfig

public CacheEvictionConfig(CacheEvictionConfig config)
Method Detail

getAsReadOnly

public CacheEvictionConfigReadOnly getAsReadOnly()

getSize

public int getSize()

setSize

public CacheEvictionConfig setSize(int size)

getMaxSizePolicy

public CacheEvictionConfig.CacheMaxSizePolicy getMaxSizePolicy()

setMaxSizePolicy

public CacheEvictionConfig setMaxSizePolicy(CacheEvictionConfig.CacheMaxSizePolicy maxSizePolicy)

getEvictionPolicy

public EvictionPolicy getEvictionPolicy()

setEvictionPolicy

public CacheEvictionConfig setEvictionPolicy(EvictionPolicy evictionPolicy)

getEvictionStrategyType

public EvictionStrategyType getEvictionStrategyType()
Description copied from interface: EvictionConfig
Gets the type of eviction strategy.

Specified by:
getEvictionStrategyType in interface EvictionConfig
Returns:
the type of eviction strategy

getEvictionPolicyType

public EvictionPolicyType getEvictionPolicyType()
Description copied from interface: EvictionConfig
Gets the type of eviction policy.

Specified by:
getEvictionPolicyType in interface EvictionConfig
Returns:
the type of eviction policy

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.