#include <gridclientdataprojection.hpp>
Public Member Functions | |
| GridClientDataProjectionImpl (TGridClientSharedDataPtr sharedData, GridClientProjectionListener &prjLsnr, const std::string &cacheName, TGridClientNodePredicatePtr filter, TGridThreadPoolPtr &threadPool, const std::set< GridClientCacheFlag > &flags) | |
| virtual | ~GridClientDataProjectionImpl () |
| virtual std::string | cacheName () const |
| virtual TGridClientDataPtr | pinNodes (const TGridClientNodeList &nodes) |
| virtual bool | put (const GridClientVariant &key, const GridClientVariant &val) |
| virtual TGridBoolFuturePtr | putAsync (const GridClientVariant &key, const GridClientVariant &val) |
| virtual bool | putAll (const TGridClientVariantMap &entries) |
| virtual TGridBoolFuturePtr | putAllAsync (const TGridClientVariantMap &entries) |
| virtual GridClientVariant | get (const GridClientVariant &key) |
| virtual TGridClientFutureVariant | getAsync (const GridClientVariant &key) |
| virtual TGridClientVariantMap | getAll (const TGridClientVariantSet &keys) |
| virtual TGridClientFutureVariantMap | getAllAsync (const TGridClientVariantSet &keys) |
| virtual bool | remove (const GridClientVariant &key) |
| virtual TGridBoolFuturePtr | removeAsync (const GridClientVariant &key) |
| virtual bool | removeAll (const TGridClientVariantSet &keys) |
| virtual TGridBoolFuturePtr | removeAllAsync (const TGridClientVariantSet &keys) |
| virtual bool | replace (const GridClientVariant &key, const GridClientVariant &val) |
| virtual TGridBoolFuturePtr | replaceAsync (const GridClientVariant &key, const GridClientVariant &val) |
| virtual bool | cas (const GridClientVariant &key, const GridClientVariant &val1, const GridClientVariant &val2) |
| virtual TGridBoolFuturePtr | casAsync (const GridClientVariant &key, const GridClientVariant &val1, const GridClientVariant &val2) |
| virtual GridClientUuid | affinity (const GridClientVariant &key) |
| virtual GridClientDataMetrics | metrics () |
| virtual TGridClientFutureDataMetrics | metricsAsync () |
| virtual std::set < GridClientCacheFlag > | flags () |
| virtual TGridClientDataPtr | flagsOn (const std::set< GridClientCacheFlag > &flags) |
| virtual TGridClientDataPtr | flagsOff (const std::set< GridClientCacheFlag > &flags) |
| void | invalidate () |
GridClientData implementation.
| GridClientDataProjectionImpl::GridClientDataProjectionImpl | ( | TGridClientSharedDataPtr | sharedData, | |
| GridClientProjectionListener & | prjLsnr, | |||
| const std::string & | cacheName, | |||
| TGridClientNodePredicatePtr | filter, | |||
| TGridThreadPoolPtr & | threadPool, | |||
| const std::set< GridClientCacheFlag > & | flags | |||
| ) |
Public constructor.
| sharedData | Client shared data. | |
| prjLsnr | Projection listener. | |
| cacheName | Cache name. | |
| filter | Projection filter. | |
| threadPool | Client thread pool. | |
| flags | Cache flags. |
| virtual GridClientDataProjectionImpl::~GridClientDataProjectionImpl | ( | ) | [inline, virtual] |
Destructor.
| GridClientUuid GridClientDataProjectionImpl::affinity | ( | const GridClientVariant & | key | ) | [virtual] |
Gets affinity node ID for provided key. This method will return null if no affinity was configured for the given cache or there are no nodes in topology with cache enabled.
| key | Key. |
| GridClientException | In case of error. |
Implements GridClientData.
| string GridClientDataProjectionImpl::cacheName | ( | ) | const [virtual] |
Implements GridClientData.
| bool GridClientDataProjectionImpl::cas | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val1, | |||
| const GridClientVariant & | val2 | |||
| ) | [virtual] |
Sets entry value to val1 if current value is val2.
If val1 is null and val2 is equal to current value, entry is removed from cache.
If val2 is null, entry is created if it doesn't exist.
If both val1 and val2 are null, entry is removed.
| key | Key. | |
| val1 | Value to set. | |
| val2 | Check value. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::casAsync | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val1, | |||
| const GridClientVariant & | val2 | |||
| ) | [virtual] |
Asynchronously sets entry value to val1 if current value is val2.
If val1 is null and val2 is equal to current value, entry is removed from cache.
If val2 is null, entry is created if it doesn't exist.
If both val1 and val2 are null, entry is removed.
| key | Key. | |
| val1 | Value to set. | |
| val2 | Check value. |
Implements GridClientData.
| std::set< GridClientCacheFlag > GridClientDataProjectionImpl::flags | ( | ) | [virtual] |
Gets cache flags enabled on this data projection.
Implements GridClientData.
| TGridClientDataPtr GridClientDataProjectionImpl::flagsOff | ( | const std::set< GridClientCacheFlag > & | flags | ) | [virtual] |
Creates new client data object with disabled cache flags.
| flags | Cache flags to be disabled. |
| GridClientException | In case of error. |
Implements GridClientData.
| TGridClientDataPtr GridClientDataProjectionImpl::flagsOn | ( | const std::set< GridClientCacheFlag > & | flags | ) | [virtual] |
Creates new client data object with enabled cache flags.
| flags | Optional cache flags to be enabled. |
| GridClientException | In case of error. |
Implements GridClientData.
| GridClientVariant GridClientDataProjectionImpl::get | ( | const GridClientVariant & | key | ) | [virtual] |
Gets value from default cache.
| key | Key. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridClientVariantMap GridClientDataProjectionImpl::getAll | ( | const TGridClientVariantSet & | keys | ) | [virtual] |
Gets entries from default cache.
| keys | Keys. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridClientFutureVariantMap GridClientDataProjectionImpl::getAllAsync | ( | const TGridClientVariantSet & | keys | ) | [virtual] |
Asynchronously gets entries from default cache.
| keys | Keys. |
Implements GridClientData.
| TGridClientFutureVariant GridClientDataProjectionImpl::getAsync | ( | const GridClientVariant & | key | ) | [virtual] |
Asynchronously gets value from default cache.
| key | key. | |
| fut | Future. |
Implements GridClientData.
| void GridClientDataProjectionImpl::invalidate | ( | ) |
Invalidates this data instance. This is done by the client to indicate that is has been stopped. After this call, all interface methods will throw GridClientClosedException.
| GridClientDataMetrics GridClientDataProjectionImpl::metrics | ( | ) | [virtual] |
Gets metrics for default cache.
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridClientFutureDataMetrics GridClientDataProjectionImpl::metricsAsync | ( | ) | [virtual] |
| TGridClientDataPtr GridClientDataProjectionImpl::pinNodes | ( | const TGridClientNodeList & | nodes | ) | [virtual] |
Gets client data which will only contact specified remote grid node. By default, remote node is determined based on GridClientDataAffinity provided - this method allows to override default behavior and use only specified server for all cache operations.
Use this method when there are other than key-affinity reasons why a certain node should be contacted.
| nodes | Optional additional nodes. |
| GridClientException | If resulting projection is empty. |
Implements GridClientData.
| bool GridClientDataProjectionImpl::put | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val | |||
| ) | [virtual] |
Puts value to default cache.
| key | The cache key. | |
| val | The key value. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| bool GridClientDataProjectionImpl::putAll | ( | const TGridClientVariantMap & | entries | ) | [virtual] |
Puts entries to the cache.
| entries | Entries. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::putAllAsync | ( | const TGridClientVariantMap & | entries | ) | [virtual] |
Asynchronously puts entries to default cache.
| entries | Entries. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::putAsync | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val | |||
| ) | [virtual] |
Asynchronously puts value to default cache.
| key | The cache key. | |
| val | The key value. |
Implements GridClientData.
| bool GridClientDataProjectionImpl::remove | ( | const GridClientVariant & | key | ) | [virtual] |
Removes value from default cache.
| key | Key. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| bool GridClientDataProjectionImpl::removeAll | ( | const TGridClientVariantSet & | keys | ) | [virtual] |
Removes entries from default cache.
| keys | Keys. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::removeAllAsync | ( | const TGridClientVariantSet & | keys | ) | [virtual] |
Asynchronously removes entries from default cache.
| keys | Keys. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::removeAsync | ( | const GridClientVariant & | key | ) | [virtual] |
Asynchronously removes value from default cache.
| key | key. |
Implements GridClientData.
| bool GridClientDataProjectionImpl::replace | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val | |||
| ) | [virtual] |
Replaces value in default cache.
| key | Key. | |
| val | Value. |
| GridClientException | In case of error. | |
| GridClientClosedException | If client was closed manually. | |
| GridServerUnreachableException | If none of the servers can be reached. |
Implements GridClientData.
| TGridBoolFuturePtr GridClientDataProjectionImpl::replaceAsync | ( | const GridClientVariant & | key, | |
| const GridClientVariant & | val | |||
| ) | [virtual] |
Asynchronously replaces value in default cache.
| key | key. | |
| val | Value. |
Implements GridClientData.
1.7.1