public class GridLocalCache<K,V> extends GridCacheAdapter<K,V>
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>| Constructor and Description |
|---|
GridLocalCache()
Empty constructor required by
Externalizable. |
GridLocalCache(GridCacheContext<K,V> ctx) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
init()
Post constructor initialization for subclasses.
|
boolean |
isLocal() |
IgniteInternalFuture<Boolean> |
lockAllAsync(Collection<? extends K> keys,
long timeout)
All or nothing synchronous lock for passed in keys.
|
IgniteInternalFuture<Boolean> |
lockAllAsync(Collection<KeyCacheObject> keys,
long timeout,
IgniteTxLocalEx tx,
CacheEntryPredicate[] filter) |
void |
onDeferredDelete(GridCacheEntryEx entry,
GridCacheVersion ver) |
GridCachePreloader<K,V> |
preloader() |
void |
removeAll()
Removes mappings from cache for entries for which the optionally passed in filters do
pass.
|
IgniteInternalFuture<?> |
removeAllAsync() |
IgniteInternalFuture<Boolean> |
txLockAsync(Collection<KeyCacheObject> keys,
long timeout,
IgniteTxLocalEx tx,
boolean isRead,
boolean retval,
TransactionIsolation isolation,
boolean invalidate,
long accessTtl) |
void |
unlockAll(Collection<? extends K> keys)
Unlocks given keys only if current thread owns the locks.
|
affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocally0, clearLocally0, clearLocallyAll, commitTxAsync, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, entries, entryEx, entryEx, entryEx, entryEx, entryExSafe, entrySet, entrySet, entrySet, entrySetx, evict, evictAll, expiry, expiryPolicy, forSubjectId, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAndPut, getAndPut, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, igfsDataSpaceMax, igfsDataSpaceUsed, igniteIterator, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isIgfsDataCache, isLocked, isLockedByThread, isMongoDataCache, isMongoMetaCache, isNear, iterator, iterator, keepPortable, keySet, keySet, loadAll, localEntries, localLoad, localLoadCache, localLoadCacheAsync, localPeek, localRemoveAll, localSize, lock, lockAll, lockAsync, log, map, metrics, metrics0, mxBean, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, offHeapIterator, onIgfsDataSizeChanged, onKernalStart, onKernalStop, onUndeploy, overflowSize, peekEx, peekEx, primaryEntrySet, primaryKeySet, primaryKeySet, primarySize, printMemoryStats, promote, promoteAll, put, put, putAll, putAllAsync, putAllConflict, putAllConflictAsync, putAsync, putAsync, putAsync0, putIfAbsent, putIfAbsentAsync, randomEntry, readExternal, readResolve, readThroughAllAsync, rebalance, reloadAllAsync0, remove, remove, removeAll, removeAllAsync, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacexAsync, saveFuture, setSkipStore, size, size, sizeAsync, skipStore, splitClearLocally, start, startInfo, stop, stopInfo, swapIterator, swapKeys, swapSize, toString, tryPutIfAbsent, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, values, values, withExpiryPolicy, writeExternalpublic GridLocalCache()
Externalizable.public GridLocalCache(GridCacheContext<K,V> ctx)
ctx - Cache registry.public boolean isLocal()
isLocal in class GridCacheAdapter<K,V>True if cache is local.public GridCachePreloader<K,V> preloader()
preloader in class GridCacheAdapter<K,V>protected void init()
init in class GridCacheAdapter<K,V>public IgniteInternalFuture<Boolean> txLockAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isRead, boolean retval, TransactionIsolation isolation, boolean invalidate, long accessTtl)
txLockAsync in class GridCacheAdapter<K,V>keys - Keys to lock.timeout - Lock timeout.tx - Transaction.isRead - True for read operations.retval - Flag to return value.isolation - Transaction isolation.invalidate - Invalidate flag.accessTtl - TTL for read operation.public IgniteInternalFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout)
TransactionConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.keys - Keys to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).true if all filters passed and locks were acquired before
timeout has expired, false otherwise.public IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, @Nullable IgniteTxLocalEx tx, CacheEntryPredicate[] filter)
keys - Keys.timeout - Timeout.tx - Transaction.filter - Filter.public void unlockAll(Collection<? extends K> keys) throws IgniteCheckedException
TransactionConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.keys - Keys to unlock.IgniteCheckedException - If unlock execution resulted in error.public void removeAll()
throws IgniteCheckedException
null, then all entries in cache will be enrolled
into transaction.
USE WITH CARE - if your cache has many entries that pass through the filter or if filter is empty, then transaction will quickly become very heavy and slow. Also, locks are acquired in undefined order, so it may cause a deadlock when used with other concurrent transactional updates.
If write-through is enabled, the values will be removed from CacheStore
via @link CacheStore#removeAll(Transaction, Collection) method.
IgniteCheckedException - If remove failed.public IgniteInternalFuture<?> removeAllAsync()
public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
onDeferredDelete in class GridCacheAdapter<K,V>entry - Entry.ver - Version.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015