K
- the key type for this IMap
proxy.V
- the value type for this IMap
proxy.public class NearCachedClientMapProxy<K,V> extends ClientMapProxy<K,V>
IMap
implementation which is fronted by a Near Cache.NULL_AGGREGATOR_IS_NOT_ALLOWED, NULL_KEY_IS_NOT_ALLOWED, NULL_LISTENER_IS_NOT_ALLOWED, NULL_PREDICATE_IS_NOT_ALLOWED, NULL_PROJECTION_IS_NOT_ALLOWED, NULL_VALUE_IS_NOT_ALLOWED
name
Constructor and Description |
---|
NearCachedClientMapProxy(String serviceName,
String name,
ClientContext context) |
Modifier and Type | Method and Description |
---|---|
String |
addNearCacheInvalidationListener(EventHandler handler) |
void |
clear()
Clears the map and invokes
MapStore.deleteAll(java.util.Collection<K>) deleteAll on MapStore which,
if connected to a database, will delete the records from that database. |
protected boolean |
containsKeyInternal(Object key) |
protected void |
deleteInternal(Object key) |
void |
evictAll()
Evicts all keys from this map except the locked ones.
|
protected boolean |
evictInternal(Object key) |
Object |
executeOnKeyInternal(Object key,
EntryProcessor entryProcessor) |
protected void |
getAllInternal(Set<K> keys,
Map<Integer,List<Data>> partitionToKeyData,
List<Object> resultingKeyValuePairs) |
ICompletableFuture<V> |
getAsyncInternal(Object keyParameter) |
protected V |
getInternal(Object key) |
LocalMapStats |
getLocalMapStats()
Returns LocalMapStats for this map.
|
NearCache<Object,Object> |
getNearCache() |
void |
loadAll(boolean replaceExistingValues)
Loads all keys into the store.
|
protected void |
loadAllInternal(boolean replaceExistingValues,
Collection<?> keysParameter) |
protected void |
onInitialize()
Called when proxy is created.
|
protected void |
onShutdown()
Called before client shutdown.
|
protected void |
postDestroy()
Called after proxy is destroyed.
|
protected Map<K,Object> |
prepareResult(Collection<Map.Entry<Data,Data>> entrySet) |
protected void |
putAllInternal(Map<? extends K,? extends V> map,
Map<Integer,List<Map.Entry<Data,Data>>> entryMap) |
protected ICompletableFuture<V> |
putAsyncInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
protected V |
putIfAbsentInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
protected V |
putInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
protected void |
putTransientInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
protected void |
removeAllInternal(Predicate predicate) |
protected ICompletableFuture<V> |
removeAsyncInternal(Object key) |
protected com.hazelcast.client.impl.protocol.codec.MapRemoveCodec.ResponseParameters |
removeInternal(Object key) |
protected boolean |
removeInternal(Object key,
Object value) |
protected boolean |
replaceIfSameInternal(Object key,
Object oldValue,
Object newValue) |
protected V |
replaceInternal(Object key,
Object value) |
protected ICompletableFuture<Void> |
setAsyncInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
protected void |
setInternal(long ttl,
TimeUnit timeunit,
Object key,
Object value) |
ICompletableFuture |
submitToKeyInternal(Object key,
EntryProcessor entryProcessor) |
void |
submitToKeyInternal(Object key,
EntryProcessor entryProcessor,
ExecutionCallback callback) |
protected boolean |
tryPutInternal(long timeout,
TimeUnit timeunit,
Object key,
Object value) |
protected boolean |
tryRemoveInternal(long timeout,
TimeUnit timeunit,
Object key) |
addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addIndex, addInterceptor, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addPartitionLostListener, aggregate, aggregate, aggregate, aggregate, containsKey, containsValue, delete, entrySet, entrySet, evict, executeOnEntries, executeOnEntries, executeOnKey, executeOnKeys, fillPartitionToKeyData, flush, forceUnlock, get, getAll, getAsync, getEntryView, getQueryCache, getQueryCache, getQueryCache, getQueryCacheContext, isEmpty, isLocked, iterator, iterator, keySet, keySet, loadAll, localKeySet, localKeySet, lock, lock, onDestroy, project, project, put, put, putAll, putAsync, putAsync, putIfAbsent, putIfAbsent, putTransient, readFromEventJournal, remove, remove, removeAll, removeAsync, removeEntryListener, removeInterceptor, removePartitionLostListener, replace, replace, set, set, setAsync, setAsync, size, submitToKey, submitToKey, subscribeToEventJournal, toString, tryLock, tryLock, tryLock, tryPut, tryRemove, unlock, values, values
deregisterListener, destroy, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, preDestroy, registerListener, setContext, toData, toObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
destroy, getName, getPartitionKey, getServiceName
public NearCachedClientMapProxy(String serviceName, String name, ClientContext context)
protected void onInitialize()
ClientProxy
onInitialize
in class ClientMapProxy<K,V>
protected boolean containsKeyInternal(Object key)
containsKeyInternal
in class ClientMapProxy<K,V>
protected V getInternal(Object key)
getInternal
in class ClientMapProxy<K,V>
public ICompletableFuture<V> getAsyncInternal(Object keyParameter)
getAsyncInternal
in class ClientMapProxy<K,V>
protected com.hazelcast.client.impl.protocol.codec.MapRemoveCodec.ResponseParameters removeInternal(Object key)
removeInternal
in class ClientMapProxy<K,V>
protected boolean removeInternal(Object key, Object value)
removeInternal
in class ClientMapProxy<K,V>
protected void removeAllInternal(Predicate predicate)
removeAllInternal
in class ClientMapProxy<K,V>
protected void deleteInternal(Object key)
deleteInternal
in class ClientMapProxy<K,V>
protected ICompletableFuture<V> putAsyncInternal(long ttl, TimeUnit timeunit, Object key, Object value)
putAsyncInternal
in class ClientMapProxy<K,V>
protected ICompletableFuture<Void> setAsyncInternal(long ttl, TimeUnit timeunit, Object key, Object value)
setAsyncInternal
in class ClientMapProxy<K,V>
protected ICompletableFuture<V> removeAsyncInternal(Object key)
removeAsyncInternal
in class ClientMapProxy<K,V>
protected boolean tryRemoveInternal(long timeout, TimeUnit timeunit, Object key)
tryRemoveInternal
in class ClientMapProxy<K,V>
protected boolean tryPutInternal(long timeout, TimeUnit timeunit, Object key, Object value)
tryPutInternal
in class ClientMapProxy<K,V>
protected V putInternal(long ttl, TimeUnit timeunit, Object key, Object value)
putInternal
in class ClientMapProxy<K,V>
protected void putTransientInternal(long ttl, TimeUnit timeunit, Object key, Object value)
putTransientInternal
in class ClientMapProxy<K,V>
protected V putIfAbsentInternal(long ttl, TimeUnit timeunit, Object key, Object value)
putIfAbsentInternal
in class ClientMapProxy<K,V>
protected boolean replaceIfSameInternal(Object key, Object oldValue, Object newValue)
replaceIfSameInternal
in class ClientMapProxy<K,V>
protected V replaceInternal(Object key, Object value)
replaceInternal
in class ClientMapProxy<K,V>
protected void setInternal(long ttl, TimeUnit timeunit, Object key, Object value)
setInternal
in class ClientMapProxy<K,V>
protected boolean evictInternal(Object key)
evictInternal
in class ClientMapProxy<K,V>
public void evictAll()
IMap
If a MapStore
is defined for this map, deleteAll is not called by this method.
If you do want to deleteAll to be called use the IMap.clear()
method.
The EVICT_ALL event is fired for any registered listeners.
See MapEvictedListener.mapEvicted(MapEvent)
.
evictAll
in interface IMap<K,V>
evictAll
in class ClientMapProxy<K,V>
IMap.clear()
public void loadAll(boolean replaceExistingValues)
IMap
protected void loadAllInternal(boolean replaceExistingValues, Collection<?> keysParameter)
loadAllInternal
in class ClientMapProxy<K,V>
protected void getAllInternal(Set<K> keys, Map<Integer,List<Data>> partitionToKeyData, List<Object> resultingKeyValuePairs)
getAllInternal
in class ClientMapProxy<K,V>
public LocalMapStats getLocalMapStats()
IMap
LocalMapStats are the statistics for the local portion of this distributed map and contains information such as ownedEntryCount backupEntryCount, lastUpdateTime, lockedEntryCount.
Since this stats are only for the local portion of this map, if you need the cluster-wide MapStats then you need to get the LocalMapStats from all members of the cluster and combine them.
getLocalMapStats
in interface IMap<K,V>
getLocalMapStats
in class ClientMapProxy<K,V>
public Object executeOnKeyInternal(Object key, EntryProcessor entryProcessor)
executeOnKeyInternal
in class ClientMapProxy<K,V>
public ICompletableFuture submitToKeyInternal(Object key, EntryProcessor entryProcessor)
submitToKeyInternal
in class ClientMapProxy<K,V>
public void submitToKeyInternal(Object key, EntryProcessor entryProcessor, ExecutionCallback callback)
submitToKeyInternal
in class ClientMapProxy<K,V>
protected Map<K,Object> prepareResult(Collection<Map.Entry<Data,Data>> entrySet)
prepareResult
in class ClientMapProxy<K,V>
protected void putAllInternal(Map<? extends K,? extends V> map, Map<Integer,List<Map.Entry<Data,Data>>> entryMap)
putAllInternal
in class ClientMapProxy<K,V>
public void clear()
IMap
MapStore.deleteAll(java.util.Collection<K>)
deleteAll on MapStore which,
if connected to a database, will delete the records from that database.
The MAP_CLEARED event is fired for any registered listeners.
See MapClearedListener.mapCleared(MapEvent)
.
To clear a map without calling MapStore.deleteAll(java.util.Collection<K>)
, use IMap.evictAll()
.
protected void postDestroy()
ClientProxy
postDestroy
in class ClientProxy
protected void onShutdown()
ClientProxy
onShutdown
in class ClientProxy
public String addNearCacheInvalidationListener(EventHandler handler)
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.