K
- the key type for this IMap
proxy.V
- the value type for this IMap
proxy.public class NearCachedMapProxyImpl<K,V> extends MapProxyImpl<K,V>
IMap
implementation which is fronted by a near-cache.Modifier and Type | Field and Description |
---|---|
protected boolean |
cacheLocalEntries |
protected KeyStateMarker |
keyStateMarker |
protected LocalMapStatsImpl |
localMapStats |
protected LockProxySupport |
lockSupport |
protected MapConfig |
mapConfig |
protected MapServiceContext |
mapServiceContext |
protected String |
name |
protected NearCache<Data,Object> |
nearCache |
protected static String |
NULL_KEY_IS_NOT_ALLOWED |
protected static String |
NULL_LISTENER_IS_NOT_ALLOWED |
protected static String |
NULL_PREDICATE_IS_NOT_ALLOWED |
protected static String |
NULL_VALUE_IS_NOT_ALLOWED |
protected MapOperationProvider |
operationProvider |
protected OperationService |
operationService |
protected IPartitionService |
partitionService |
protected PartitioningStrategy |
partitionStrategy |
protected SerializationService |
serializationService |
protected boolean |
statisticsEnabled |
protected Address |
thisAddress |
PARTITIONING_STRATEGY
Constructor and Description |
---|
NearCachedMapProxyImpl(String name,
MapService mapService,
NodeEngine nodeEngine,
MapConfig mapConfig) |
Modifier and Type | Method and Description |
---|---|
protected String |
addEntryListenerInternal(Object listener,
Data key,
boolean includeValue) |
protected String |
addEntryListenerInternal(Object listener,
Predicate predicate,
Data key,
boolean includeValue) |
void |
addIndex(String attribute,
boolean ordered) |
String |
addLocalEntryListenerInternal(Object listener) |
String |
addLocalEntryListenerInternal(Object listener,
Predicate predicate,
Data key,
boolean includeValue) |
String |
addMapInterceptorInternal(MapInterceptor interceptor) |
protected String |
addPartitionLostListenerInternal(MapPartitionLostListener listener) |
void |
clearInternal() |
protected boolean |
containsKeyInternal(Data keyData) |
boolean |
containsValueInternal(Data dataValue) |
protected <K> Iterable<Data> |
convertToData(Iterable<K> keys) |
protected void |
deleteInternal(Data key) |
protected void |
evictAllInternal() |
protected boolean |
evictInternal(Data key)
Evicts a key from a map.
|
void |
executeOnEntriesInternal(EntryProcessor entryProcessor,
Predicate predicate,
List<Data> resultingKeyValuePairs)
|
Data |
executeOnKeyInternal(Data key,
EntryProcessor entryProcessor) |
ICompletableFuture |
executeOnKeyInternal(Data key,
EntryProcessor entryProcessor,
ExecutionCallback<Object> callback) |
Map |
executeOnKeysInternal(Set<Data> keys,
EntryProcessor entryProcessor) |
void |
flush() |
protected void |
getAllObjectInternal(List<Data> keys,
List<Object> resultingKeyValuePairs) |
protected ICompletableFuture<Data> |
getAsyncInternal(Data key) |
protected Object |
getCachedValue(Data key) |
protected void |
getCachedValue(List<Data> keys,
List<Object> resultingKeyValuePairs) |
protected EntryView |
getEntryViewInternal(Data key) |
protected Object |
getInternal(Data key) |
KeyStateMarker |
getKeyStateMarker() |
LocalMapStats |
getLocalMapStats() |
protected MapConfig |
getMapConfig() |
protected MapQueryEngine |
getMapQueryEngine() |
String |
getName()
Returns the unique name for this DistributedObject.
|
NearCache |
getNearCache() |
MapOperationProvider |
getOperationProvider() |
PartitioningStrategy |
getPartitionStrategy() |
String |
getServiceName()
Returns the service name for this object.
|
protected long |
getTimeInMillis(long time,
TimeUnit timeunit) |
int |
getTotalBackupCount() |
protected void |
init() |
void |
initialize() |
protected void |
invalidateCache(Collection<Data> keys) |
protected void |
invalidateCache(Data key) |
protected void |
invalidateCache(Iterable<Data> keys) |
protected void |
invokePutAllOperationFactory(Address address,
long size,
int[] partitions,
MapEntries[] entries) |
protected boolean |
isCachedNull(Object value) |
boolean |
isEmpty() |
protected boolean |
isMapStoreEnabled() |
protected boolean |
isOwn(Data key) |
void |
loadAllInternal(boolean replaceExistingValues) |
protected void |
loadInternal(Iterable<Data> keys,
boolean replaceExistingValues)
Maps keys to corresponding partitions and sends operations to them.
|
protected void |
putAllInternal(Map<?,?> map)
This method will group all puts per partition and send a
PutAllPartitionAwareOperationFactory per member. |
protected ICompletableFuture<Data> |
putAsyncInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected Data |
putIfAbsentInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected Data |
putInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected void |
putTransientInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected ICompletableFuture<Data> |
removeAsyncInternal(Data key) |
protected boolean |
removeEntryListenerInternal(String id) |
protected Data |
removeInternal(Data key) |
protected boolean |
removeInternal(Data key,
Data value) |
void |
removeMapInterceptorInternal(String id) |
protected boolean |
removePartitionLostListenerInternal(String id) |
protected Data |
replaceInternal(Data key,
Data value) |
protected boolean |
replaceInternal(Data key,
Data expect,
Data update) |
protected ICompletableFuture<Data> |
setAsyncInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
protected void |
setInternal(Data key,
Data value,
long ttl,
TimeUnit timeunit) |
void |
setOperationProvider(MapOperationProvider operationProvider) |
int |
size() |
protected Data |
toData(Object object,
PartitioningStrategy partitioningStrategy) |
protected <T> T |
toObject(Object object) |
protected boolean |
tryPutInternal(Data key,
Data value,
long timeout,
TimeUnit timeunit) |
protected boolean |
tryRemoveInternal(Data key,
long timeout,
TimeUnit timeunit) |
void |
waitUntilLoaded() |
addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addEntryListener, addInterceptor, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addLocalEntryListener, addPartitionLostListener, aggregate, aggregate, clear, clearMapOnly, containsKey, containsValue, delete, entrySet, entrySet, evict, evictAll, executeOnEntries, executeOnEntries, executeOnKey, executeOnKeys, forceUnlock, get, getAll, getAsync, getEntryView, invoke, isLocked, iterator, keySet, keySet, loadAll, loadAll, localKeySet, localKeySet, lock, lock, put, put, putAll, putAsync, putAsync, putIfAbsent, putIfAbsent, putTransient, remove, remove, removeAsync, removeEntryListener, removeInterceptor, removePartitionLostListener, replace, replace, set, set, setAsync, setAsync, submitToKey, submitToKey, toString, tryLock, tryLock, tryLock, tryPut, tryRemove, unlock, values, values
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, postDestroy, preDestroy, throwNotActiveException, toData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addIndex, flush, getLocalMapStats
destroy, getName, getPartitionKey, getServiceName
protected KeyStateMarker keyStateMarker
protected boolean cacheLocalEntries
protected static final String NULL_KEY_IS_NOT_ALLOWED
protected static final String NULL_VALUE_IS_NOT_ALLOWED
protected static final String NULL_PREDICATE_IS_NOT_ALLOWED
protected static final String NULL_LISTENER_IS_NOT_ALLOWED
protected final String name
protected final LocalMapStatsImpl localMapStats
protected final LockProxySupport lockSupport
protected final PartitioningStrategy partitionStrategy
protected final MapServiceContext mapServiceContext
protected final IPartitionService partitionService
protected final Address thisAddress
protected final OperationService operationService
protected final SerializationService serializationService
protected final boolean statisticsEnabled
protected final MapConfig mapConfig
protected MapOperationProvider operationProvider
public NearCachedMapProxyImpl(String name, MapService mapService, NodeEngine nodeEngine, MapConfig mapConfig)
public void initialize()
initialize
in interface InitializingObject
protected void init()
protected ICompletableFuture<Data> getAsyncInternal(Data key)
protected boolean isCachedNull(Object value)
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 ICompletableFuture<Data> setAsyncInternal(Data key, Data value, long ttl, TimeUnit timeunit)
protected boolean evictInternal(Data key)
key
- the key to evicttrue
if eviction was successful, false
otherwiseprotected void evictAllInternal()
public void loadAllInternal(boolean replaceExistingValues)
protected void loadInternal(Iterable<Data> keys, boolean replaceExistingValues)
protected void deleteInternal(Data key)
protected ICompletableFuture<Data> removeAsyncInternal(Data key)
protected boolean containsKeyInternal(Data keyData)
protected void getAllObjectInternal(List<Data> keys, List<Object> resultingKeyValuePairs)
protected void invokePutAllOperationFactory(Address address, long size, int[] partitions, MapEntries[] entries) throws Exception
Exception
public Data executeOnKeyInternal(Data key, EntryProcessor entryProcessor)
public Map executeOnKeysInternal(Set<Data> keys, EntryProcessor entryProcessor)
public ICompletableFuture executeOnKeyInternal(Data key, EntryProcessor entryProcessor, ExecutionCallback<Object> callback)
public void executeOnEntriesInternal(EntryProcessor entryProcessor, Predicate predicate, List<Data> resultingKeyValuePairs)
protected void invalidateCache(Data key)
protected void invalidateCache(Collection<Data> keys)
protected boolean isOwn(Data key)
public NearCache getNearCache()
public KeyStateMarker getKeyStateMarker()
public void waitUntilLoaded()
public int size()
public boolean containsValueInternal(Data dataValue)
public boolean isEmpty()
protected void putAllInternal(Map<?,?> map)
PutAllPartitionAwareOperationFactory
per member.
If there are e.g. five keys for a single member, there will only be a single remote invocation
instead of having five remote invocations.
There is also an optional support for batching to send smaller packages.
Takes care about null
checks for keys and values.public void flush()
public void clearInternal()
public String addMapInterceptorInternal(MapInterceptor interceptor)
public void removeMapInterceptorInternal(String id)
public String addLocalEntryListenerInternal(Object listener, Predicate predicate, Data key, boolean includeValue)
protected String addEntryListenerInternal(Object listener, Data key, boolean includeValue)
protected String addEntryListenerInternal(Object listener, Predicate predicate, Data key, boolean includeValue)
protected boolean removeEntryListenerInternal(String id)
protected String addPartitionLostListenerInternal(MapPartitionLostListener listener)
protected boolean removePartitionLostListenerInternal(String id)
protected <T> T toObject(Object object)
protected Data toData(Object object, PartitioningStrategy partitioningStrategy)
public void addIndex(String attribute, boolean ordered)
public LocalMapStats getLocalMapStats()
protected long getTimeInMillis(long time, TimeUnit timeunit)
protected MapQueryEngine getMapQueryEngine()
protected boolean isMapStoreEnabled()
protected MapConfig getMapConfig()
public final String getName()
DistributedObject
DistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject
.getName
in interface DistributedObject
public final String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<MapService>
public PartitioningStrategy getPartitionStrategy()
public void setOperationProvider(MapOperationProvider operationProvider)
public MapOperationProvider getOperationProvider()
public int getTotalBackupCount()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.