Package org.apache.ignite.configuration
Class NearCacheConfiguration<K,V>
- java.lang.Object
-
- org.apache.ignite.configuration.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 Summary
Constructors Constructor Description NearCacheConfiguration()
Empty constructor.NearCacheConfiguration(NearCacheConfiguration<K,V> ccfg)
Creates near cache configuration copying properties from passed in configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EvictionPolicy<K,V>
getNearEvictionPolicy()
Deprecated.UsegetNearEvictionPolicyFactory()
instead.@Nullable javax.cache.configuration.Factory<EvictionPolicy<? super K,? super V>>
getNearEvictionPolicyFactory()
Gets cache eviction policy factory.int
getNearStartSize()
Gets initial cache size for near cache which will be used to pre-create internal hash table after start.NearCacheConfiguration<K,V>
setNearEvictionPolicy(EvictionPolicy<K,V> nearEvictPlc)
Deprecated.UsesetNearEvictionPolicyFactory(Factory)
instead.NearCacheConfiguration<K,V>
setNearEvictionPolicyFactory(@Nullable javax.cache.configuration.Factory<? extends EvictionPolicy<? super K,? super V>> nearEvictPlcFactory)
Sets cache eviction policy factory.NearCacheConfiguration<K,V>
setNearStartSize(int nearStartSize)
Start size for near cache.String
toString()
-
-
-
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
-
getNearEvictionPolicy
@Deprecated public EvictionPolicy<K,V> getNearEvictionPolicy()
Deprecated.UsegetNearEvictionPolicyFactory()
instead.Gets near eviction policy. By default, returnsnull
which means that evictions are disabled for near cache.- Returns:
- Near eviction policy.
- See Also:
CacheConfiguration.getEvictionPolicy()
-
setNearEvictionPolicy
@Deprecated public NearCacheConfiguration<K,V> setNearEvictionPolicy(EvictionPolicy<K,V> nearEvictPlc)
Deprecated.UsesetNearEvictionPolicyFactory(Factory)
instead.Sets near eviction policy.- Parameters:
nearEvictPlc
- Near eviction policy.- Returns:
this
for chaining.
-
getNearEvictionPolicyFactory
@Nullable public @Nullable javax.cache.configuration.Factory<EvictionPolicy<? super K,? super V>> getNearEvictionPolicyFactory()
Gets cache eviction policy factory. By default, returnsnull
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 beSerializable
.- 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 byCacheConfiguration.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 forCacheMode.PARTITIONED
caching mode.- Parameters:
nearStartSize
- Start size for near cache.- Returns:
this
for chaining.
-
-