public class MapProxyImpl<K,V> extends AbstractDistributedObject<MapService> implements IMap<K,V>, InitializingObject
Modifier and Type | Field and Description |
---|---|
protected LocalMapStatsImpl |
localMapStats |
protected LockProxySupport |
lockSupport |
protected MapConfig |
mapConfig |
protected String |
name |
protected static String |
NULL_KEY_IS_NOT_ALLOWED |
protected static String |
NULL_VALUE_IS_NOT_ALLOWED |
protected PartitioningStrategy |
partitionStrategy |
PARTITIONING_STRATEGY
Constructor and Description |
---|
MapProxyImpl(String name,
MapService mapService,
NodeEngine nodeEngine) |
Modifier and Type | Method and Description |
---|---|
String |
addEntryListener(EntryListener<K,V> listener,
K key,
boolean includeValue)
Adds the specified entry listener for the specified key.
|
String |
addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
boolean includeValue)
Adds an continuous entry listener for this map.
|
String |
addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
K key,
boolean includeValue)
Adds an continuous entry listener for this map.
|
String |
addEntryListener(EntryListener listener,
boolean includeValue)
Adds an entry listener for this map.
|
protected String |
addEntryListenerInternal(EntryListener listener,
Data key,
boolean includeValue) |
protected String |
addEntryListenerInternal(EntryListener listener,
Predicate predicate,
Data key,
boolean includeValue) |
void |
addIndex(String attribute,
boolean ordered) |
String |
addInterceptor(MapInterceptor interceptor)
Adds an interceptor for this map.
|
String |
addLocalEntryListener(EntryListener listener) |
String |
addLocalEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
boolean includeValue)
Adds a local entry listener for this map.
|
String |
addLocalEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
K key,
boolean includeValue)
Adds a local entry listener for this map.
|
String |
addLocalEntryListenerInternal(EntryListener listener,
Predicate predicate,
Data key,
boolean includeValue) |
String |
addMapInterceptorInternal(MapInterceptor interceptor) |
void |
clear() |
void |
clearInternal() |
boolean |
containsKey(Object k)
Returns
true if this map contains an entry for the specified
key. |
protected boolean |
containsKeyInternal(Data key) |
boolean |
containsValue(Object v) |
boolean |
containsValueInternal(Data dataValue) |
void |
delete(Object k)
Removes the mapping for a key from this map if it is present
(optional operation).
|
protected void |
deleteInternal(Data key) |
Set |
entrySet()
Returns a
Set clone of the mappings contained in this map. |
Set |
entrySet(Predicate predicate)
Queries the map based on the specified predicate and
returns the matching entries.
|
protected Set<Map.Entry<Data,Data>> |
entrySetInternal() |
boolean |
evict(Object key)
Evicts the specified key from this map.
|
protected boolean |
evictInternal(Data key) |
Map |
executeOnEntries(EntryProcessor entryProcessor)
|
Map |
executeOnEntries(EntryProcessor entryProcessor,
Predicate predicate)
|
Object |
executeOnKey(K key,
EntryProcessor entryProcessor)
Applies the user defined EntryProcessor to the entry mapped by the key.
|
Data |
executeOnKeyInternal(Data key,
EntryProcessor entryProcessor) |
ICompletableFuture |
executeOnKeyInternal(Data key,
EntryProcessor entryProcessor,
ExecutionCallback callback) |
Map<K,Object> |
executeOnKeys(Set<K> keys,
EntryProcessor entryProcessor)
Applies the user defined EntryProcessor to the entries mapped by the collection of keys.
|
Map |
executeOnKeysInternal(Set<Data> keys,
EntryProcessor entryProcessor) |
void |
flush() |
void |
forceUnlock(K key)
Releases the lock for the specified key regardless of the lock owner.
|
V |
get(Object k)
Returns the value for the specified key, or
null if this map does not contain this key. |
Map<K,V> |
getAll(Set<K> keys)
Returns the entries for the given keys.
|
protected Map<Object,Object> |
getAllObjectInternal(Set<Data> keys) |
Future<V> |
getAsync(K k)
Asynchronously gets the given key.
|
protected ICompletableFuture<Data> |
getAsyncInternal(Data key) |
EntryView<K,V> |
getEntryView(K key)
Returns the EntryView for the specified key.
|
protected EntryView |
getEntryViewInternal(Data key) |
protected Object |
getInternal(Data key) |
LocalMapStats |
getLocalMapStats() |
String |
getName()
Returns the unique name for this DistributedObject.
|
String |
getServiceName()
Returns the service name for this object.
|
protected long |
getTimeInMillis(long time,
TimeUnit timeunit) |
void |
initialize() |
protected Object |
invoke(Operation operation,
int partitionId) |
boolean |
isEmpty() |
boolean |
isLocked(K k)
Checks the lock for the specified key.
|
Set<K> |
keySet()
Returns a set clone of the keys contained in this map.
|
Set<K> |
keySet(Predicate predicate)
Queries the map based on the specified predicate and
returns the keys of matching entries.
|
protected Set<Data> |
keySetInternal() |
Set<K> |
localKeySet()
Returns the locally owned set of keys.
|
Set<K> |
localKeySet(Predicate predicate)
Returns the keys of matching locally owned entries.
|
protected Set<Data> |
localKeySetInternal() |
void |
lock(K key)
Acquires the lock for the specified key.
|
void |
lock(Object key,
long leaseTime,
TimeUnit timeUnit)
Acquires the lock for the specified key for the specified lease time.
|
V |
put(K k,
V v)
Associates the specified value with the specified key in this map
If the map previously contained a mapping for
the key, the old value is replaced by the specified value.
|
V |
put(K k,
V v,
long ttl,
TimeUnit timeunit)
Puts an entry into this map with a given ttl (time to live) value.
|
void |
putAll(Map<? extends K,? extends V> m) |
protected void |
putAllInternal(Map<? extends Object,? extends Object> entries) |
Future |
putAsync(K key,
V value)
Asynchronously puts the given key and value.
|
ICompletableFuture |
putAsync(K key,
V value,
long ttl,
TimeUnit timeunit)
Asynchronously puts the given key and value into this map with a given ttl (time to live) value.
|
protected ICompletableFuture<Data> |
putAsyncInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
V |
putIfAbsent(K k,
V v)
If the specified key is not already associated
with a value, associate it with the given value.
|
V |
putIfAbsent(K k,
V v,
long ttl,
TimeUnit timeunit)
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.
|
protected Data |
putIfAbsentInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected Data |
putInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
void |
putTransient(K k,
V v,
long ttl,
TimeUnit timeunit)
Same as
#put(K, V, long, TimeUnit) but MapStore, if defined,
will not be called to store/persist the entry. |
protected void |
putTransientInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected Set |
query(Predicate predicate,
IterationType iterationType,
boolean dataResult) |
protected Set |
queryLocal(Predicate predicate,
IterationType iterationType,
boolean dataResult) |
V |
remove(Object k)
Removes the mapping for a key from this map if it is present.
|
boolean |
remove(Object k,
Object v)
Removes the entry for a key only if currently mapped to a given value.
|
ICompletableFuture |
removeAsync(K key)
Asynchronously removes the given key.
|
protected ICompletableFuture<Data> |
removeAsyncInternal(Data key) |
boolean |
removeEntryListener(String id)
Removes the specified entry listener
Returns silently if there is no such listener added before.
|
protected boolean |
removeEntryListenerInternal(String id) |
void |
removeInterceptor(String id)
Removes the given interceptor for this map.
|
protected Data |
removeInternal(Data key) |
protected boolean |
removeInternal(Data key,
Data value) |
void |
removeMapInterceptorInternal(String id) |
V |
replace(K k,
V v)
Replaces the entry for a key only if currently mapped to some value.
|
boolean |
replace(K k,
V o,
V v)
Replaces the entry for a key only if currently mapped to a given value.
|
protected Data |
replaceInternal(Data key,
Data value) |
protected boolean |
replaceInternal(Data key,
Data oldValue,
Data newValue) |
void |
set(K key,
V value)
Puts an entry into this map.
|
void |
set(K k,
V v,
long ttl,
TimeUnit timeunit)
Puts an entry into this map with a given ttl (time to live) value.
|
protected void |
setInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
int |
size() |
ICompletableFuture |
submitToKey(K key,
EntryProcessor entryProcessor)
Applies the user defined EntryProcessor to the entry mapped by the key.
|
void |
submitToKey(K key,
EntryProcessor entryProcessor,
ExecutionCallback callback)
Applies the user defined EntryProcessor to the entry mapped by the key with
specified ExecutionCallback to listen event status and returns immediately.
|
String |
toString() |
boolean |
tryLock(K key)
Tries to acquire the lock for the specified key.
|
boolean |
tryLock(K key,
long time,
TimeUnit timeunit)
Tries to acquire the lock for the specified key.
|
boolean |
tryPut(K k,
V v,
long timeout,
TimeUnit timeunit)
Tries to put the given key, value into this map within specified
timeout value.
|
protected boolean |
tryPutInternal(Data key,
Data value,
long timeout,
TimeUnit timeunit) |
boolean |
tryRemove(K key,
long timeout,
TimeUnit timeunit)
Tries to remove the entry with the given key from this map
within specified timeout value.
|
protected boolean |
tryRemoveInternal(Data key,
long timeout,
TimeUnit timeunit) |
void |
unlock(K key)
Releases the lock for the specified key.
|
Collection<V> |
values()
Returns a collection clone of the values contained in this map.
|
Collection<V> |
values(Predicate predicate)
Queries the map based on the specified predicate and
returns the values of matching entries.
|
protected Collection<Data> |
valuesInternal() |
void |
waitUntilLoaded() |
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addIndex, addLocalEntryListener, executeOnEntries, executeOnEntries, flush, getLocalMapStats
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
destroy, getId, getName, getPartitionKey, getServiceName
initialize
protected static final String NULL_KEY_IS_NOT_ALLOWED
protected static final String NULL_VALUE_IS_NOT_ALLOWED
protected final String name
protected final MapConfig mapConfig
protected final LocalMapStatsImpl localMapStats
protected final LockProxySupport lockSupport
protected final PartitioningStrategy partitionStrategy
public MapProxyImpl(String name, MapService mapService, NodeEngine nodeEngine)
public V get(Object k)
IMap
null
if this map does not contain this key.
Warning:
This method returns a clone of original value, modifying the returned value does not change the actual value in the map. One should put modified value back to make changes visible to all nodes.
V value = map.get(key); value.updateSomeProperty(); map.put(key, value);
Warning-2:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public V put(K k, V v)
IMap
Warning:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
Warning-2:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public V put(K k, V v, long ttl, TimeUnit timeunit)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
public boolean tryPut(K k, V v, long timeout, TimeUnit timeunit)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public V putIfAbsent(K k, V v)
IMap
if (!map.containsKey(key)) return map.put(key, value); else return map.get(key);except that the action is performed atomically.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
putIfAbsent
in interface BaseMap<K,V>
putIfAbsent
in interface IMap<K,V>
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in interface Map<K,V>
k
- keyv
- valuekey
or null
if there was no mapping for key
.public V putIfAbsent(K k, V v, long ttl, TimeUnit timeunit)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
putIfAbsent
in interface IMap<K,V>
k
- key of the entryv
- value of the entryttl
- maximum time for this entry to stay in the maptimeunit
- time unit for the ttlpublic void putTransient(K k, V v, long ttl, TimeUnit timeunit)
IMap
#put(K, V, long, TimeUnit)
but MapStore, if defined,
will not be called to store/persist the entry. If ttl is 0, then
the entry lives forever.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.putTransient
in interface IMap<K,V>
k
- key of the entryv
- value of the entryttl
- maximum time for this entry to stay in the map.
0 means infinite.timeunit
- time unit for the ttlpublic boolean replace(K k, V o, V v)
IMap
if (map.containsKey(key) && map.get(key).equals(oldValue)) { map.put(key, newValue); return true; } else return false;except that the action is performed atomically.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public V replace(K k, V v)
IMap
if (map.containsKey(key)) { return map.put(key, value); } else return null;except that the action is performed atomically.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
replace
in interface BaseMap<K,V>
replace
in interface IMap<K,V>
replace
in interface ConcurrentMap<K,V>
replace
in interface Map<K,V>
k
- keyv
- valuekey
or null
if there was no mapping for key
.public void set(K key, V value)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public void set(K k, V v, long ttl, TimeUnit timeunit)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public V remove(Object k)
IMap
The map will not contain a mapping for the specified key once the call returns.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
public boolean remove(Object k, Object v)
IMap
if (map.containsKey(key) && map.get(key).equals(value)) { map.remove(key); return true; } else return false;except that the action is performed atomically.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public void delete(Object k)
IMap
Differently from IMap.remove(Object)
; this operation does not return
removed value to avoid serialization cost of returned value.
If the removed value will not be used, delete operation
should be preferred over remove operation for a better performance.
The map will not contain a mapping for the specified key once the call returns.
public boolean containsKey(Object k)
IMap
true
if this map contains an entry for the specified
key.
Warning:
ˆ This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.
containsKey
in interface BaseMap<K,V>
containsKey
in interface IMap<K,V>
containsKey
in interface Map<K,V>
k
- keytrue
if this map contains an entry for the specified keypublic boolean containsValue(Object v)
IMap
containsValue
in interface IMap<K,V>
containsValue
in interface Map<K,V>
public void lock(K key)
IMap
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired.
You get a lock whether the value is present in the map or not. Other threads (possibly on other systems) would block on their invoke oflock()
until the non-existent key is unlocked. If the lock
holder introduces the key to the map, the put()
operation
is not blocked. If a thread not holding a lock on the non-existent key
tries to introduce the key while a lock exists on the non-existent key,
the put()
operation blocks until it is unlocked.
Scope of the lock is this map only.
Acquired lock is only for the key in this map.
Locks are re-entrant so if the key is locked N times then
it should be unlocked N times before another thread can acquire it.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public void lock(Object key, long leaseTime, TimeUnit timeUnit)
IMap
After lease time, lock will be released..
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired.
Scope of the lock is this map only. Acquired lock is only for the key in this map. Locks are re-entrant so if the key is locked N times then it should be unlocked N times before another thread can acquire it.Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public void unlock(K key)
IMap
If the current thread is the holder of this lock then the hold
count is decremented. If the hold count is now zero then the lock
is released. If the current thread is not the holder of this
lock then IllegalMonitorStateException
is thrown.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public boolean tryRemove(K key, long timeout, TimeUnit timeunit)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.Warning-2:
This method returns a clone of previous value, not the original (identically equal) value previously put into map.
public Future<V> getAsync(K k)
IMap
Future future = map.getAsync(key);
// do some other stuff, when ready get the result
Object value = future.get();
Future.get() will block until the actual map.get() completes.
If the application requires timely response,
then Future.get(timeout, timeunit) can be used.
try{
Future future = map.getAsync(key);
Object value = future.get(40, TimeUnit.MILLISECOND);
}catch (TimeoutException t) {
// time wasn't enough
}
ExecutionException is never thrown.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public boolean isLocked(K k)
IMap
If the lock is acquired then returns true, else false.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public Future putAsync(K key, V value)
IMap
Future future = map.putAsync(key, value);
// do some other stuff, when ready get the result
Object oldValue = future.get();
Future.get() will block until the actual map.get() completes.
If the application requires timely response,
then Future.get(timeout, timeunit) can be used.
try{
Future future = map.putAsync(key, newValue);
Object oldValue = future.get(40, TimeUnit.MILLISECOND);
}catch (TimeoutException t) {
// time wasn't enough
}
ExecutionException is never thrown.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public ICompletableFuture putAsync(K key, V value, long ttl, TimeUnit timeunit)
IMap
Future future = map.putAsync(key, value, ttl, timeunit);
// do some other stuff, when ready get the result
Object oldValue = future.get();
Future.get() will block until the actual map.get() completes.
If the application requires timely response,
then Future.get(timeout, timeunit) can be used.
try{
Future future = map.putAsync(key, newValue, ttl, timeunit);
Object oldValue = future.get(40, TimeUnit.MILLISECOND);
}catch (TimeoutException t) {
// time wasn't enough
}
ExecutionException is never thrown.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.putAsync
in interface IMap<K,V>
key
- the key of the map entryvalue
- the new value of the map entryttl
- maximum time for this entry to stay in the map
0 means infinite.timeunit
- time unit for the ttlFuture
public ICompletableFuture removeAsync(K key)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.removeAsync
in interface IMap<K,V>
key
- The key of the map entry to remove.Future
from which the value
removed from the map can be retrieved.public Map<K,V> getAll(Set<K> keys)
IMap
Warning:
The returned map is NOT backed by the original map, so changes to the original map are NOT reflected in the returned map, and vice-versa.Warning-2:
This method uses hashCode and equals of binary form of the keys, not the actual implementations of hashCode and equals defined in key's class.public boolean tryLock(K key)
IMap
If the lock is not available then the current thread doesn't wait and returns false immediately.
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public boolean tryLock(K key, long time, TimeUnit timeunit) throws InterruptedException
IMap
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.tryLock
in interface IMap<K,V>
key
- key to lock in this maptime
- maximum time to wait for the locktimeunit
- time unit of the time argument.InterruptedException
public void forceUnlock(K key)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.forceUnlock
in interface IMap<K,V>
key
- key to lock.public String addInterceptor(MapInterceptor interceptor)
IMap
addInterceptor
in interface IMap<K,V>
interceptor
- map interceptorpublic void removeInterceptor(String id)
IMap
removeInterceptor
in interface IMap<K,V>
id
- registration id of map interceptorpublic String addLocalEntryListener(EntryListener<K,V> listener, Predicate<K,V> predicate, boolean includeValue)
IMap
addLocalEntryListener
in interface IMap<K,V>
listener
- entry listenerpredicate
- predicate for filtering entriesincludeValue
- true if EntryEvent should
contain the value.public String addLocalEntryListener(EntryListener<K,V> listener, Predicate<K,V> predicate, K key, boolean includeValue)
IMap
addLocalEntryListener
in interface IMap<K,V>
listener
- entry listenerpredicate
- predicate for filtering entrieskey
- key to listenincludeValue
- true if EntryEvent should
contain the value.public String addEntryListener(EntryListener listener, boolean includeValue)
IMap
addEntryListener
in interface IMap<K,V>
listener
- entry listenerincludeValue
- true if EntryEvent should
contain the value.public String addEntryListener(EntryListener<K,V> listener, K key, boolean includeValue)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.addEntryListener
in interface IMap<K,V>
listener
- entry listenerkey
- key to listenincludeValue
- true if EntryEvent should
contain the value.public String addEntryListener(EntryListener<K,V> listener, Predicate<K,V> predicate, K key, boolean includeValue)
IMap
addEntryListener
in interface IMap<K,V>
listener
- entry listenerpredicate
- predicate for filtering entrieskey
- key to listenincludeValue
- true if EntryEvent should
contain the value.public String addEntryListener(EntryListener<K,V> listener, Predicate<K,V> predicate, boolean includeValue)
IMap
addEntryListener
in interface IMap<K,V>
listener
- entry listenerpredicate
- predicate for filtering entriesincludeValue
- true if EntryEvent should
contain the value.public boolean removeEntryListener(String id)
IMap
removeEntryListener
in interface IMap<K,V>
id
- id of registered listenerpublic EntryView<K,V> getEntryView(K key)
IMap
Warning:
This method returns a clone of original mapping, modifying the returned value does not change the actual value in the map. One should put modified value back to make changes visible to all nodes.
Warning-2:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.getEntryView
in interface IMap<K,V>
key
- key of the entryEntryView
public boolean evict(Object key)
IMap
Warning:
This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class.public Set<K> keySet()
IMap
public Collection<V> values()
IMap
public Set entrySet()
IMap
Set
clone of the mappings contained in this map.
The set is NOT backed by the map,
so changes to the map are NOT reflected in the set, and vice-versa.public Set<K> keySet(Predicate predicate)
IMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.public Set entrySet(Predicate predicate)
IMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.public Collection<V> values(Predicate predicate)
IMap
Warning:
The collection is NOT backed by the map, so changes to the map are NOT reflected in the collection, and vice-versa.public Set<K> localKeySet()
IMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.localKeySet
in interface IMap<K,V>
public Set<K> localKeySet(Predicate predicate)
IMap
Warning:
The set is NOT backed by the map, so changes to the map are NOT reflected in the set, and vice-versa.localKeySet
in interface IMap<K,V>
predicate
- query criteriapublic Object executeOnKey(K key, EntryProcessor entryProcessor)
IMap
executeOnKey
in interface IMap<K,V>
public Map<K,Object> executeOnKeys(Set<K> keys, EntryProcessor entryProcessor)
IMap
executeOnKeys
in interface IMap<K,V>
public void submitToKey(K key, EntryProcessor entryProcessor, ExecutionCallback callback)
IMap
submitToKey
in interface IMap<K,V>
key
- key to be processedentryProcessor
- processor to process the keycallback
- to listen whether operation is finished or notpublic ICompletableFuture submitToKey(K key, EntryProcessor entryProcessor)
IMap
submitToKey
in interface IMap<K,V>
key
- key to be processedentryProcessor
- processor to process the keyFuture
protected Object invoke(Operation operation, int partitionId) throws Throwable
Throwable
public void initialize()
initialize
in interface InitializingObject
protected ICompletableFuture<Data> getAsyncInternal(Data key)
protected boolean tryPutInternal(Data key, Data value, long timeout, TimeUnit timeunit)
protected Data putIfAbsentInternal(Data key, Data value, long ttl, TimeUnit timeunit)
protected void putTransientInternal(Data key, Data value, long ttl, TimeUnit timeunit)
protected ICompletableFuture<Data> putAsyncInternal(Data key, Data value, long ttl, TimeUnit timeunit)
protected boolean evictInternal(Data key)
protected void deleteInternal(Data key)
protected ICompletableFuture<Data> removeAsyncInternal(Data key)
protected boolean containsKeyInternal(Data key)
public void waitUntilLoaded()
public int size()
public boolean containsValueInternal(Data dataValue)
public boolean isEmpty()
public void flush()
protected Collection<Data> valuesInternal()
public void clearInternal()
public String addMapInterceptorInternal(MapInterceptor interceptor)
public void removeMapInterceptorInternal(String id)
public String addLocalEntryListener(EntryListener listener)
public String addLocalEntryListenerInternal(EntryListener listener, Predicate predicate, Data key, boolean includeValue)
protected String addEntryListenerInternal(EntryListener listener, Data key, boolean includeValue)
protected String addEntryListenerInternal(EntryListener listener, Predicate predicate, Data key, boolean includeValue)
protected boolean removeEntryListenerInternal(String id)
public Data executeOnKeyInternal(Data key, EntryProcessor entryProcessor)
public Map executeOnKeysInternal(Set<Data> keys, EntryProcessor entryProcessor)
public ICompletableFuture executeOnKeyInternal(Data key, EntryProcessor entryProcessor, ExecutionCallback callback)
public Map executeOnEntries(EntryProcessor entryProcessor)
public Map executeOnEntries(EntryProcessor entryProcessor, Predicate predicate)
protected Set queryLocal(Predicate predicate, IterationType iterationType, boolean dataResult)
protected Set query(Predicate predicate, IterationType iterationType, boolean dataResult)
public void addIndex(String attribute, boolean ordered)
public LocalMapStats getLocalMapStats()
protected long getTimeInMillis(long time, TimeUnit timeunit)
public final String getName()
DistributedObject
getName
in interface DistributedObject
public final String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<MapService>
Copyright © 2014 Hazelcast, Inc.. All rights reserved.