|
virtual boost::shared_ptr< V > | put (const K &key, const V &value, int64_t ttl)=0 |
|
virtual void | putAll (const std::map< K, V > &entries)=0 |
| Copies all of the mappings from the specified map to this map (optional operation). More...
|
|
virtual void | clear ()=0 |
|
virtual bool | removeEntryListener (const std::string ®istrationId)=0 |
| Removes the specified entry listener. More...
|
|
virtual std::string | addEntryListener (const boost::shared_ptr< EntryListener< K, V > > &listener)=0 |
| Adds an entry listener for this map. More...
|
|
virtual std::string | addEntryListener (const boost::shared_ptr< EntryListener< K, V > > &listener, const K &key)=0 |
| Adds the specified entry listener for the specified key. More...
|
|
virtual const std::string | addEntryListener (const boost::shared_ptr< EntryListener< K, V > > &listener, const query::Predicate &predicate)=0 |
| Adds an continuous entry listener for this map. More...
|
|
virtual std::string | addEntryListener (const boost::shared_ptr< EntryListener< K, V > > &listener, const query::Predicate &predicate, const K &key)=0 |
| Adds an continuous entry listener for this map. More...
|
|
virtual boost::shared_ptr< DataArray< V > > | values ()=0 |
| Due to the lazy nature of the returned array, changes to the map (addition, removal, update) might be reflected on the collection. More...
|
|
virtual boost::shared_ptr< LazyEntryArray< K, V > > | entrySet ()=0 |
| Returns a lazy LazyEntryArray view of the mappings contained in this map. More...
|
|
virtual boost::shared_ptr< DataArray< K > > | keySet ()=0 |
| Returns a lazy DataArray view of the key contained in this map. More...
|
|
virtual int32_t | size ()=0 |
|
virtual bool | isEmpty ()=0 |
|
virtual bool | containsKey (const K &key)=0 |
|
virtual bool | containsValue (const V &value)=0 |
|
virtual boost::shared_ptr< V > | get (const K &key)=0 |
|
virtual boost::shared_ptr< V > | put (const K &key, const V &value)=0 |
|
virtual boost::shared_ptr< V > | remove (const K &key)=0 |
|
virtual const std::string & | getServiceName () const =0 |
| Returns the service name for this object.
|
|
virtual const std::string & | getName () const =0 |
| Returns the unique name for this DistributedObject. More...
|
|
virtual void | destroy ()=0 |
| Destroys this object cluster-wide. More...
|
|
virtual | ~DistributedObject () |
| Destructor.
|
|
template<typename K, typename V>
class hazelcast::client::ReplicatedMap< K, V >
A ReplicatedMap is a map-like data structure with weak consistency and values locally stored on every node of the cluster.
Whenever a value is written asynchronously, the new value will be internally distributed to all existing cluster members, and eventually every node will have the new value.
When a new node joins the cluster, the new node initially will request existing values from older nodes and replicate them locally.
- Parameters
-
<K> | the type of keys maintained by this map |
<V> | the type of mapped values |
template<typename K , typename V >
Adds the specified entry listener for the specified key.
The listener will be notified for all add/remove/update/evict events of the specified key only.
Warning:
This method uses hashCode
and equals
of the binary form of the key
, not the actual implementations of hashCode
.
- Parameters
-
listener | the entry listener to add |
key | the key to listen to |
template<typename K , typename V >
Returns a lazy LazyEntryArray view of the mappings contained in this map.
Due to the lazy nature of the returned array, changes to the map (addition, removal, update) might be reflected on the array.
Changes on the map are NOT reflected on the set on the CLIENT or vice versa. The order of the elements is not guaranteed due to the internal asynchronous replication behavior.
Changes to any returned object are NOT replicated back to other members.
- Returns
- A lazy set view of the mappings contained in this map.
template<typename K , typename V >
Returns a lazy DataArray view of the key contained in this map.
Due to the lazy nature of the returned array, changes to the map (addition, removal, update) might be reflected on the array.
Changes on the map are NOT reflected on the set on the CLIENT or vice versa. The order of the elements is not guaranteed due to the internal asynchronous replication behavior.
Changes to any returned object are NOT replicated back to other members.
- Returns
- A lazy Set view of the keys contained in this map.
template<typename K , typename V >
Associates a given value to the specified key and replicates it to the cluster. If there is an old value, it will be replaced by the specified one and returned from the call.
In addition, you have to specify a ttl in milliseconds to define when the value is outdated and thus should be removed from the replicated map.
- Parameters
-
key | key with which the specified value is to be associated. |
value | value to be associated with the specified key. |
ttl | ttl in milliseconds to be associated with the specified key-value pair. |
template<typename K , typename V >
Copies all of the mappings from the specified map to this map (optional operation).
The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k
to value v
in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.
- Parameters
-
entries | mappings to be stored in this map |
template<typename K , typename V >
Due to the lazy nature of the returned array, changes to the map (addition, removal, update) might be reflected on the collection.
Changes on the map are NOT reflected on the collection on the CLIENT or vice versa. The order of the elements is not guaranteed due to the internal asynchronous replication behavior. If a specific order is needed, use values(Comparator) to force reordering of the elements before returning.
Changes to any returned object are NOT replicated back to other members.
- Returns
- A collection view of the values contained in this map.