com.hazelcast.cache.impl.nearcache
Interface NearCacheRecordStore<K,V>

Type Parameters:
K - the type of the key
V - the type of the value
All Known Implementing Classes:
AbstractNearCacheRecordStore, BaseHeapNearCacheRecordStore, NearCacheDataRecordStore, NearCacheObjectRecordStore

public interface NearCacheRecordStore<K,V>

NearCacheRecordStore is the contract point to store keys and values as NearCacheRecord internally and to serve them.


Method Summary
 void clear()
          Removes all stored values.
 void destroy()
          Clears the record store and destroys it.
 void doEvictionIfRequired()
          Does eviction as specified configuration EvictionConfig in NearCacheConfig.
 void doExpiration()
          Performs expiration and evicts expired records.
 V get(K key)
          Gets the value associated with the given key.
 NearCacheStats getNearCacheStats()
          Get the NearCacheStats instance to monitor this record store.
 void put(K key, V value)
          Puts (associates) a value with the given key.
 boolean remove(K key)
          Removes the value associated with the given key.
 Object selectToSave(Object... candidates)
          Selects the best candidate object to store from the given candidates.
 int size()
          Gets the number of stored records.
 

Method Detail

get

V get(K key)
Gets the value associated with the given key.

Parameters:
key - the key from which to get the associated value.
Returns:
the value associated with the given key.

put

void put(K key,
         V value)
Puts (associates) a value with the given key.

Parameters:
key - the key to which the given value will be associated.
value - the value that will be associated with the key.

remove

boolean remove(K key)
Removes the value associated with the given key.

Parameters:
key - the key from which the value will be removed.
Returns:
true if the value was removed, otherwise false.

clear

void clear()
Removes all stored values.


destroy

void destroy()
Clears the record store and destroys it.


getNearCacheStats

NearCacheStats getNearCacheStats()
Get the NearCacheStats instance to monitor this record store.

Returns:
the NearCacheStats instance to monitor this record store.

selectToSave

Object selectToSave(Object... candidates)
Selects the best candidate object to store from the given candidates.

Parameters:
candidates - the candidates from which the best candidate object will be selected.
Returns:
the best candidate object to store, selected from the given candidates.

size

int size()
Gets the number of stored records.

Returns:
the number of stored records.

doExpiration

void doExpiration()
Performs expiration and evicts expired records.


doEvictionIfRequired

void doEvictionIfRequired()
Does eviction as specified configuration EvictionConfig in NearCacheConfig.



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