public class GridDhtColocatedCache<K,V> extends GridDhtTransactionalCacheAdapter<K,V>
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>preldr| Constructor and Description |
|---|
GridDhtColocatedCache()
Empty constructor required for
Externalizable |
GridDhtColocatedCache(GridCacheContext<K,V> ctx) |
GridDhtColocatedCache(GridCacheContext<K,V> ctx,
GridCacheConcurrentMap map)
Creates colocated cache with specified map.
|
| Modifier and Type | Method and Description |
|---|---|
javax.cache.Cache.Entry<K,V> |
entry(K key)
Gets entry from cache with the specified key.
|
protected GridCacheEntryEx |
entryExSafe(KeyCacheObject key,
long topVer) |
GridDistributedCacheEntry |
entryExx(KeyCacheObject key,
long topVer,
boolean allowDetached)
Gets or creates entry for given key and given topology version.
|
IgniteInternalFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
GridCacheEntryEx entry,
UUID subjId,
String taskName,
boolean deserializePortable,
boolean skipVals)
This method is used internally.
|
protected void |
init()
Post constructor initialization for subclasses.
|
boolean |
isColocated() |
boolean |
isLocked(K key)
Checks if any node owns a lock for this key.
|
boolean |
isLockedByThread(K key)
Checks if current thread owns a lock on this key.
|
IgniteInternalFuture<Map<K,V>> |
loadAsync(Collection<KeyCacheObject> keys,
boolean readThrough,
boolean reload,
boolean forcePrimary,
long topVer,
UUID subjId,
String taskName,
boolean deserializePortable,
IgniteCacheExpiryPolicy expiryPlc,
boolean skipVals) |
IgniteInternalFuture<Boolean> |
lockAllAsync(Collection<KeyCacheObject> keys,
long timeout,
IgniteTxLocalEx tx,
boolean isInvalidate,
boolean isRead,
boolean retval,
TransactionIsolation isolation,
long accessTtl,
CacheEntryPredicate[] filter)
This is an entry point to pessimistic locking within transaction.
|
GridNearTransactionalCache<K,V> |
near() |
V |
peek(K key,
Collection<GridCachePeekMode> modes)
Peeks at cached value using optional set of peek modes.
|
void |
removeLocks(long threadId,
GridCacheVersion ver,
Collection<KeyCacheObject> keys)
Removes locks regardless of whether they are owned or not for given
version and keys.
|
void |
start()
Starts this cache.
|
String |
toString() |
void |
unlockAll(Collection<? extends K> keys,
CacheEntryPredicate[] filter)
Unlocks given keys only if current thread owns the locks.
|
lockAllAsync, lockAllAsyncInternal, processDhtLockRequest, processDhtLockRequest0, processDhtUnlockRequest, removeLocksbeginMultiUpdate, dhtPreloader, endMultiUpdate, entryEx, entryEx, entryExx, entryExx, entryExx, entrySet, getDhtAsync, localEntriesIterator, localLoad, localLoadCache, multiUpdateFinishFuture, multiUpdateTopologyFuture, onDeferredDelete, onKernalStart, onKernalStop, peekExx, preloader, primarySize, printMemoryStats, processNearGetRequest, reload, sendTtlUpdateRequest, splitClearLocally, stop, topologylockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsyncaffinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clear, clearAll, clearAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocally0, clearLocally0, clearLocallyAll, commitTxAsync, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, containsValue, context, entries, entryEx, entryEx, entrySet, entrySet, entrySetx, evict, evict, evictAll, evictAll, evictAll, expiry, expiryPolicy, flags, flagsOff, flagsOn, forceRepartition, forSubjectId, get, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, globalPrimarySize, globalSize, gridProjection, igfsDataSpaceMax, igfsDataSpaceUsed, igniteIterator, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isDht, isDhtAtomic, isEmpty, isIgfsDataCache, isLocal, isMongoDataCache, isMongoMetaCache, isNear, iterator, iterator, keepPortable, keepPortable0, keySet, keySet, loadAll, localEntries, localLoadCacheAsync, localPeek, localRemoveAll, localRemoveAll, localSize, lock, lockAll, lockAsync, log, map, metrics, metrics0, mxBean, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, offHeapIterator, onIgfsDataSizeChanged, onUndeploy, overflowSize, peek, peek, peek0, peek0, peek0, peekAll0, peekEx, peekEx, predicate, primaryEntrySet, primaryEntrySet, primaryEntrySetx, primaryKeySet, primaryKeySet, primaryValues, primaryValues, projection, projection, promote, promote, promoteAll, put, put, putAll, putAllAsync, putAllConflict, putAllConflictAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putx, putx, putxAsync, putxAsync, putxIfAbsent, putxIfAbsentAsync, queries, randomEntry, readExternal, readResolve, readThroughAllAsync, reloadAllAsync0, reloadAsync, remove, remove, remove, removeAll, removeAllAsync, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removex, removex, removexAsync, removexAsync, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacex, replacexAsync, replacexAsync, saveFuture, size, size, sizeAsync, startInfo, stopInfo, swapIterator, swapKeys, swapSize, toMap, tx, txStart, txStart, txStart, txStartEx, txSynchronizations, txSynchronize, txUnsynchronize, unlock, validateCacheKey, validateCacheKeys, values, values, withExpiryPolicy, writeExternalpublic GridDhtColocatedCache()
Externalizablepublic GridDhtColocatedCache(GridCacheContext<K,V> ctx)
ctx - Cache context.public GridDhtColocatedCache(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)
ctx - Cache context.map - Cache map.public boolean isColocated()
isColocated in class GridCacheAdapter<K,V>True if cache is colocated.protected void init()
init in class GridDhtCacheAdapter<K,V>public void start()
throws IgniteCheckedException
start in class GridDhtTransactionalCacheAdapter<K,V>IgniteCheckedException - If start failed.public GridDistributedCacheEntry entryExx(KeyCacheObject key, long topVer, boolean allowDetached)
key - Key for entry.topVer - Topology version.allowDetached - Whether to allow detached entries. If true and node is not primary
for given key, a new detached entry will be created. Otherwise, entry will be obtained from
dht cache map.GridDhtInvalidPartitionException - If allowDetached is false and node is not primary
for given key.public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException
non-null value is found, it will be immediately returned.
Note that if modes are not provided this method works exactly the same way as
CacheProjection.peek(Object), implicitly using GridCachePeekMode.SMART mode.
peek in interface CacheProjection<K,V>peek in class GridCacheAdapter<K,V>key - Entry key.modes - Optional set of peek modes.IgniteCheckedException - If peek operation failed.public boolean isLocked(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLocked in interface CacheProjection<K,V>isLocked in class GridCacheAdapter<K,V>key - Key to check.True if lock is owned by some node.public boolean isLockedByThread(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLockedByThread in interface CacheProjection<K,V>isLockedByThread in class GridCacheAdapter<K,V>key - Key to check.True if key is locked by current thread.public IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable GridCacheEntryEx entry, @Nullable UUID subjId, String taskName, boolean deserializePortable, boolean skipVals)
#getDhtAsync(UUID, long, LinkedHashMap, boolean, boolean, long, UUID, int, boolean, IgniteCacheExpiryPolicy, boolean)
method instead to retrieve DHT value.getAllAsync in class GridDhtCacheAdapter<K,V>keys - forcePrimary - skipTx - protected GridCacheEntryEx entryExSafe(KeyCacheObject key, long topVer)
entryExSafe in class GridCacheAdapter<K,V>key - Key.topVer - Topology version.public IgniteInternalFuture<Map<K,V>> loadAsync(@Nullable Collection<KeyCacheObject> keys, boolean readThrough, boolean reload, boolean forcePrimary, long topVer, @Nullable UUID subjId, String taskName, boolean deserializePortable, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals)
keys - Keys to load.readThrough - Read through flag.reload - Reload flag.forcePrimary - Force get from primary node flag.topVer - Topology version.subjId - Subject ID.taskName - Task name.deserializePortable - Deserialize portable flag.expiryPlc - Expiry policy.skipVals - Skip values flag.public IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, @Nullable IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, long accessTtl, CacheEntryPredicate[] filter)
lockAllAsync in class GridDhtTransactionalCacheAdapter<K,V>keys - Keys to lock.timeout - Timeout.tx - TransactionisInvalidate - Invalidation flag.isRead - Indicates whether value is read or written.retval - Flag to return value.isolation - Transaction isolation.accessTtl - TTL for read operation.filter - Optional filter.public GridNearTransactionalCache<K,V> near()
near in class GridDhtTransactionalCacheAdapter<K,V>public javax.cache.Cache.Entry<K,V> entry(K key) throws GridDhtInvalidPartitionException
Note that this method can return null if projection is configured as
pre-filtered and entry key and value don't pass key-value filter of the projection.
entry in interface CacheProjection<K,V>entry in class GridDhtCacheAdapter<K,V>key - Entry key.null if projection pre-filtering was not passed.GridDhtInvalidPartitionException - If partition for the key is no longer valid.public void unlockAll(Collection<? extends K> keys, CacheEntryPredicate[] filter)
TransactionConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
CacheFlag.LOCAL, CacheFlag.READ.unlockAll in interface CacheProjection<K,V>unlockAll in class GridDhtCacheAdapter<K,V>keys - Keys to unlock.filter - Optional filter which needs to pass for individual entries
to be unlocked.public void removeLocks(long threadId,
GridCacheVersion ver,
Collection<KeyCacheObject> keys)
threadId - Thread ID.ver - Lock version.keys - Keys.public String toString()
toString in class GridDhtCacheAdapter<K,V>
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015