Class NearCacheConfiguration<K,​V>

  • All Implemented Interfaces:
    Serializable

    public class NearCacheConfiguration<K,​V>
    extends Object
    implements Serializable
    Client (near) cache configuration.

    Distributed cache can also be fronted by a Near cache, which is a smaller local cache that stores most recently or most frequently accessed data. Just like with a partitioned cache, the user can control the size of the near cache and its eviction policies.

    See Also:
    Serialized Form
    • Constructor Detail

      • NearCacheConfiguration

        public NearCacheConfiguration()
        Empty constructor.
      • NearCacheConfiguration

        public NearCacheConfiguration​(NearCacheConfiguration<K,​V> ccfg)
        Creates near cache configuration copying properties from passed in configuration.
        Parameters:
        ccfg - Configuration to copy.
    • Method Detail

      • getNearEvictionPolicyFactory

        @Nullable
        public @Nullable javax.cache.configuration.Factory<EvictionPolicy<? super K,​? super V>> getNearEvictionPolicyFactory()
        Gets cache eviction policy factory. By default, returns null which means that evictions are disabled for cache.
        Returns:
        Cache eviction policy or null if evictions should be disabled.
      • setNearEvictionPolicyFactory

        public NearCacheConfiguration<K,​V> setNearEvictionPolicyFactory​(@Nullable
                                                                              @Nullable javax.cache.configuration.Factory<? extends EvictionPolicy<? super K,​? super V>> nearEvictPlcFactory)
        Sets cache eviction policy factory. Note: Eviction policy factory should be Serializable.
        Parameters:
        nearEvictPlcFactory - Cache expiration policy.
        Returns:
        this for chaining.
      • getNearStartSize

        public int getNearStartSize()
        Gets initial cache size for near cache which will be used to pre-create internal hash table after start. Default value is defined by CacheConfiguration.DFLT_NEAR_START_SIZE.
        Returns:
        Initial near cache size.
      • setNearStartSize

        public NearCacheConfiguration<K,​V> setNearStartSize​(int nearStartSize)
        Start size for near cache. This property is only used for CacheMode.PARTITIONED caching mode.
        Parameters:
        nearStartSize - Start size for near cache.
        Returns:
        this for chaining.