Hazelcast C++ Client
|
Concurrent, distributed, observable and queryable map client. More...
#include <NearCachedClientMapProxy.h>
Public Member Functions | |
NearCachedClientMapProxy (const std::string &instanceName, spi::ClientContext *context, const mixedtype::config::MixedNearCacheConfig &config) | |
virtual monitor::LocalMapStats & | getLocalMapStats () |
Public Member Functions inherited from hazelcast::client::mixedtype::ClientMapProxy | |
ClientMapProxy (const std::string &instanceName, spi::ClientContext *context) | |
template<typename K > | |
bool | containsKey (const K &key) |
check if this map contains key. More... | |
template<typename V > | |
bool | containsValue (const V &value) |
check if this map contains value. More... | |
template<typename K > | |
TypedData | get (const K &key) |
get the value. More... | |
template<typename K , typename V > | |
TypedData | put (const K &key, const V &value) |
put new entry into map. More... | |
template<typename K , typename V > | |
TypedData | put (const K &key, const V &value, long ttlInMillis) |
Puts an entry into this map with a given ttl (time to live) value. More... | |
template<typename K > | |
TypedData | remove (const K &key) |
remove entry form map More... | |
template<typename K , typename V > | |
bool | remove (const K &key, const V &value) |
removes entry from map if there is an entry with same key and value. More... | |
void | removeAll (const query::Predicate &predicate) |
Removes all entries which match with the supplied predicate. More... | |
template<typename K > | |
void | deleteEntry (const K &key) |
removes entry from map. More... | |
void | flush () |
If this map has a MapStore this method flushes all the local dirty entries by calling MapStore.storeAll() and/or MapStore.deleteAll() | |
template<typename K > | |
bool | tryRemove (const K &key, long timeoutInMillis) |
Tries to remove the entry with the given key from this map within specified timeout value. More... | |
template<typename K , typename V > | |
bool | tryPut (const K &key, const V &value, long timeoutInMillis) |
Tries to put the given key, value into this map within specified timeout value. More... | |
template<typename K , typename V > | |
void | putTransient (const K &key, const V &value, long ttlInMillis) |
Same as put(K, V, long, TimeUnit) but MapStore, if defined, will not be called to store/persist the entry. More... | |
template<typename K , typename V > | |
TypedData | putIfAbsent (const K &key, const V &value) |
Puts an entry into this map, if the specified key is not already associated with a value. More... | |
template<typename K , typename V > | |
TypedData | putIfAbsent (const K &key, const V &value, long ttlInMillis) |
Puts an entry into this map with a given ttl (time to live) value if the specified key is not already associated with a value. More... | |
template<typename K , typename V , typename NEWTYPE > | |
bool | replace (const K &key, const V &oldValue, const NEWTYPE &newValue) |
Replaces the entry for a key only if currently mapped to a given value. More... | |
template<typename K , typename V > | |
TypedData | replace (const K &key, const V &value) |
Replaces the entry for a key only if currently mapped to some value. More... | |
template<typename K , typename V > | |
void | set (const K &key, const V &value) |
Puts an entry into this map. More... | |
template<typename K , typename V > | |
void | set (const K &key, const V &value, long ttl) |
Puts an entry into this map. More... | |
template<typename K > | |
void | lock (const K &key) |
Acquires the lock for the specified key. More... | |
template<typename K > | |
void | lock (const K &key, long leaseTime) |
Acquires the lock for the specified key for the specified lease time. More... | |
template<typename K > | |
bool | isLocked (const K &key) |
Checks the lock for the specified key. More... | |
template<typename K > | |
bool | tryLock (const K &key) |
Tries to acquire the lock for the specified key. More... | |
template<typename K > | |
bool | tryLock (const K &key, long timeInMillis) |
Tries to acquire the lock for the specified key. More... | |
template<typename K > | |
void | unlock (const K &key) |
Releases the lock for the specified key. More... | |
template<typename K > | |
void | forceUnlock (const K &key) |
Releases the lock for the specified key regardless of the lock owner. More... | |
template<typename MapInterceptor > | |
std::string | addInterceptor (MapInterceptor &interceptor) |
Adds an interceptor for this map. More... | |
void | removeInterceptor (const std::string &id) |
Removes the given interceptor for this map. More... | |
std::string | addEntryListener (MixedEntryListener &listener, bool includeValue) |
Adds an entry listener for this map. More... | |
std::string | addEntryListener (MixedEntryListener &listener, const query::Predicate &predicate, bool includeValue) |
Adds an entry listener for this map. More... | |
bool | removeEntryListener (const std::string ®istrationId) |
Removes the specified entry listener Returns silently if there is no such listener added before. More... | |
template<typename K > | |
std::string | addEntryListener (const K &key, MixedEntryListener &listener, bool includeValue) |
Adds the specified entry listener for the specified key. More... | |
template<typename K > | |
std::auto_ptr< EntryView< TypedData, TypedData > > | getEntryView (const K &key) |
Returns the EntryView for the specified key. More... | |
template<typename K > | |
bool | evict (const K &key) |
Evicts the specified key from this map. More... | |
void | evictAll () |
Evicts all keys from this map except locked ones. More... | |
template<typename K > | |
std::vector< std::pair< TypedData, TypedData > > | getAll (const std::set< K > &keys) |
Returns the entries for the given keys. More... | |
std::vector< TypedData > | keySet () |
Returns a vector clone of the keys contained in this map. More... | |
std::vector< TypedData > | keySet (const serialization::IdentifiedDataSerializable &predicate) |
std::vector< TypedData > | keySet (const query::Predicate &predicate) |
Queries the map based on the specified predicate and returns the keys of matching entries. More... | |
template<typename K , typename V > | |
std::vector< K > | keySet (query::PagingPredicate< K, V > &predicate) |
Queries the map based on the specified predicate and returns the keys of matching entries. More... | |
std::vector< TypedData > | values () |
Returns a vector clone of the values contained in this map. More... | |
std::vector< TypedData > | values (const serialization::IdentifiedDataSerializable &predicate) |
std::vector< TypedData > | values (const query::Predicate &predicate) |
Returns a vector clone of the values contained in this map. More... | |
template<typename K , typename V > | |
std::vector< V > | values (query::PagingPredicate< K, V > &predicate) |
Returns a vector clone of the values contained in this map. More... | |
std::vector< std::pair< TypedData, TypedData > > | entrySet () |
Returns a std::vector< std::pair<K, V> > clone of the mappings contained in this map. More... | |
std::vector< std::pair< TypedData, TypedData > > | entrySet (const serialization::IdentifiedDataSerializable &predicate) |
std::vector< std::pair< TypedData, TypedData > > | entrySet (const query::Predicate &predicate) |
Queries the map based on the specified predicate and returns the matching entries. More... | |
template<typename K , typename V > | |
std::vector< std::pair< K, V > > | entrySet (query::PagingPredicate< K, V > &predicate) |
Queries the map based on the specified predicate and returns the matching entries. More... | |
void | addIndex (const std::string &attribute, bool ordered) |
Adds an index to this map for the specified entries so that queries can run faster. More... | |
template<typename K , typename EntryProcessor > | |
TypedData | executeOnKey (const K &key, const EntryProcessor &entryProcessor) |
Applies the user defined EntryProcessor to the entry mapped by the key. More... | |
template<typename K , typename EntryProcessor > | |
Future< TypedData > | submitToKey (const K &key, const EntryProcessor &entryProcessor) |
template<typename K , typename EntryProcessor > | |
std::map< K, TypedData > | executeOnKeys (const std::set< K > &keys, const EntryProcessor &entryProcessor) |
template<typename EntryProcessor > | |
std::map< TypedData, TypedData > | executeOnEntries (const EntryProcessor &entryProcessor) |
Applies the user defined EntryProcessor to the all entries in the map. More... | |
template<typename EntryProcessor > | |
std::map< TypedData, TypedData > | executeOnEntries (const EntryProcessor &entryProcessor, const query::Predicate &predicate) |
Applies the user defined EntryProcessor to the all entries in the map. More... | |
int | size () |
Returns the number of key-value mappings in this map. More... | |
bool | isEmpty () |
Returns true if this map contains no key-value mappings. More... | |
template<typename K , typename V > | |
void | putAll (const std::map< K, V > &entries) |
Copies all of the mappings from the specified map to this map (optional operation). More... | |
void | clear () |
Removes all of the mappings from this map (optional operation). More... | |
serialization::pimpl::SerializationService & | getSerializationService () const |
Protected Member Functions | |
void | onInitialize () |
bool | containsKeyInternal (const serialization::pimpl::Data &keyData) |
boost::shared_ptr< TypedData > | getInternal (serialization::pimpl::Data &keyData) |
virtual std::auto_ptr< serialization::pimpl::Data > | removeInternal (const serialization::pimpl::Data &key) |
virtual bool | removeInternal (const serialization::pimpl::Data &key, const serialization::pimpl::Data &value) |
virtual void | removeAllInternal (const serialization::pimpl::Data &predicateData) |
virtual void | deleteInternal (const serialization::pimpl::Data &key) |
virtual bool | tryRemoveInternal (const serialization::pimpl::Data &key, long timeoutInMillis) |
virtual bool | tryPutInternal (const serialization::pimpl::Data &key, const serialization::pimpl::Data &value, long timeoutInMillis) |
virtual std::auto_ptr< serialization::pimpl::Data > | putInternal (const serialization::pimpl::Data &key, const serialization::pimpl::Data &value, long timeoutInMillis) |
virtual void | tryPutTransientInternal (const serialization::pimpl::Data &key, const serialization::pimpl::Data &value, int ttlInMillis) |
virtual std::auto_ptr< serialization::pimpl::Data > | putIfAbsentInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &valueData, int ttlInMillis) |
virtual bool | replaceIfSameInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &valueData, const serialization::pimpl::Data &newValueData) |
virtual std::auto_ptr< serialization::pimpl::Data > | replaceInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &valueData) |
virtual void | setInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &valueData, int ttlInMillis) |
virtual bool | evictInternal (const serialization::pimpl::Data &keyData) |
EntryVector | getAllInternal (ClientMapProxy::PID_TO_KEY_MAP &pIdToKeyData) |
virtual std::auto_ptr< serialization::pimpl::Data > | executeOnKeyInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &processor) |
virtual void | putAllInternal (const std::map< int, EntryVector > &entries) |
Protected Member Functions inherited from hazelcast::client::mixedtype::ClientMapProxy | |
EntryVector | getAllInternal (const PID_TO_KEY_MAP &partitionToKeyData) |
template<typename ResultType > | |
Future< ResultType > | submitToKeyInternal (const serialization::pimpl::Data &keyData, const serialization::pimpl::Data &processor) |
template<typename K , typename EntryProcessor > | |
EntryVector | executeOnKeysInternal (const std::set< K > &keys, const EntryProcessor &entryProcessor) |
Additional Inherited Members | |
Public Types inherited from hazelcast::client::mixedtype::ClientMapProxy | |
typedef std::map< int, std::vector< boost::shared_ptr< serialization::pimpl::Data > > > | PID_TO_KEY_MAP |
Static Protected Member Functions inherited from hazelcast::client::mixedtype::ClientMapProxy | |
static std::auto_ptr< serialization::pimpl::Data > | submitToKeyDecoder (protocol::ClientMessage &response) |
Concurrent, distributed, observable and queryable map client.
Notice that this class have a private constructor. You can access get an IMap in the following way
ClientConfig clientConfig; HazelcastClient client(clientConfig); MixedMap map = client.getMixedMap("aKey");