|
| CacheClient (common::concurrent::SharedPointer< void > impl) |
| Constructor. More...
|
|
| CacheClient () |
| Default constructor.
|
|
| ~CacheClient () |
| Destructor.
|
|
void | Put (const KeyType &key, const ValueType &value) |
| Associate the specified value with the specified key in the cache. More...
|
|
template<typename InIter > |
void | PutAll (InIter begin, InIter end) |
| Stores given key-value pairs in cache. More...
|
|
template<typename Map > |
void | PutAll (const Map &vals) |
| Stores given key-value pairs in cache. More...
|
|
void | Get (const KeyType &key, ValueType &value) |
| Get value from the cache. More...
|
|
ValueType | Get (const KeyType &key) |
| Get value from cache. More...
|
|
template<typename InIter , typename OutIter > |
void | GetAll (InIter begin, InIter end, OutIter dst) |
| Retrieves values mapped to the specified keys from cache. More...
|
|
template<typename Set , typename Map > |
void | GetAll (const Set &keys, Map &res) |
| Retrieves values mapped to the specified keys from cache. More...
|
|
bool | Replace (const K &key, const V &value) |
| Stores given key-value pair in cache only if there is a previous mapping for it. More...
|
|
bool | ContainsKey (const KeyType &key) |
| Check if the cache contains a value for the specified key. More...
|
|
template<typename Set > |
bool | ContainsKeys (const Set &keys) |
| Check if cache contains mapping for these keys. More...
|
|
template<typename InIter > |
bool | ContainsKeys (InIter begin, InIter end) |
| Check if cache contains mapping for these keys. More...
|
|
int64_t | GetSize (int32_t peekModes) |
| Gets the number of all entries cached across all nodes. More...
|
|
bool | Remove (const KeyType &key) |
| Removes given key mapping from cache. More...
|
|
template<typename Set > |
void | RemoveAll (const Set &keys) |
| Removes given key mappings from cache. More...
|
|
template<typename InIter > |
void | RemoveAll (InIter begin, InIter end) |
| Removes given key mappings from cache. More...
|
|
void | RemoveAll () |
| Removes all mappings from cache. More...
|
|
void | Clear (const KeyType &key) |
| Clear entry from the cache and swap storage, without notifying listeners or CacheWriters. More...
|
|
void | Clear () |
| Clear cache.
|
|
template<typename Set > |
void | ClearAll (const Set &keys) |
| Clear entries from the cache and swap storage, without notifying listeners or CacheWriters. More...
|
|
template<typename InIter > |
void | ClearAll (InIter begin, InIter end) |
| Clear entries from the cache and swap storage, without notifying listeners or CacheWriters. More...
|
|
void | RefreshAffinityMapping () |
| Refresh affinity mapping. More...
|
|
template<typename K, typename V>
class ignite::thin::cache::CacheClient< K, V >
Cache client class template.
Main entry point for all Data Grid APIs.
Both key and value types should be default-constructable, copy-constructable and assignable. Also BinaryType class template should be specialized for both types, if they are not one of the basic types.
This class implemented as a reference to an implementation so copying of this class instance will only create another reference to the same underlying object. Underlying object released automatically once all the instances are destructed.
- Template Parameters
-
K | Cache key type. |
V | Cache value type. |
template<typename K, typename V>
template<typename InIter >
Clear entries from the cache and swap storage, without notifying listeners or CacheWriters.
Entry is cleared only if it is not currently locked, and is not participating in a transaction.
- Parameters
-
begin | Iterator pointing to the beginning of the key sequence. |
end | Iterator pointing to the end of the key sequence. |
template<typename K, typename V>
template<typename InIter , typename OutIter >
Retrieves values mapped to the specified keys from cache.
If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from persistent store.
- Parameters
-
begin | Iterator pointing to the beginning of the key sequence. |
end | Iterator pointing to the end of the key sequence. |
dst | Output iterator. Should dereference to std::pair or CacheEntry. |
template<typename K, typename V>
template<typename Set , typename Map >
Retrieves values mapped to the specified keys from cache.
If some value is not present in cache, then it will be looked up from swap storage. If it's not present in swap, or if swap is disabled, and if read-through is allowed, value will be loaded from persistent store.
- Parameters
-
keys | Keys. |
res | Map of key-value pairs. |
template<typename K, typename V>
Refresh affinity mapping.
Retrieves affinity mapping information from remote server. This information uses to send data requests to the most appropriate nodes. This can lessen latency and improve overall performance.
It is recommended to refresh affinity mapping after every topology change, i.e. when a node enters or leaves cluster.
template<typename K, typename V>
Removes given key mapping from cache.
If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the disk-based swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If the returned value is not needed, method removex() should always be used instead of this one to avoid the overhead associated with returning of the previous value. If write-through is enabled, the value will be removed from store.
- Parameters
-
key | Key whose mapping is to be removed from cache. |
- Returns
- False if there was no matching key.
template<typename K, typename V>
Stores given key-value pair in cache only if there is a previous mapping for it.
If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, rom the underlying persistent storage. If write-through is enabled, the stored value will be persisted to store.
- Parameters
-
key | Key to store in cache. |
value | Value to be associated with the given key. |
- Returns
- True if the value was replaced.