/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(true); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(true); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** {@inheritDoc} */ @Override public void unlockAll( Collection<? extends K> keys ) throws IgniteCheckedException { AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); for (K key : keys) { GridLocalCacheEntry entry = peekExx(ctx.toCacheKeyObject(key)); if (entry != null && ctx.isAll(entry, CU.empty0())) { entry.releaseLocal(); entry.touch(); } } }
/** * Adds local key future. * * @param key Key to add. * @param topVer Topology version. * @param distributedKeys Collection of keys needs to be locked. * @return {@code True} if transaction accesses key that was explicitly locked before. * @throws IgniteCheckedException If lock is externally held and transaction is explicit. */ private boolean addLocalKey( KeyCacheObject key, AffinityTopologyVersion topVer, Collection<KeyCacheObject> distributedKeys ) throws IgniteCheckedException { GridDistributedCacheEntry entry = cctx.colocated().entryExx(key, topVer, false); assert !entry.detached(); if (!cctx.isAll(entry, filter)) { if (log.isDebugEnabled()) log.debug("Entry being locked did not pass filter (will not lock): " + entry); onComplete(false, false); return false; } GridCacheMvccCandidate cand = addEntry(entry); if (cand != null && !cand.reentry()) distributedKeys.add(key); return inTx() && cand == null; }
if (!cctx.isAll(entry, filter)) { onFailed();
entry = cctx.colocated().entryExx(key, topVer, true); if (!cctx.isAll(entry, filter)) { if (log.isDebugEnabled()) log.debug("Entry being locked did not pass filter (will not lock): " + entry);
entry = cctx.near().entryExx(key, topVer); if (!cctx.isAll(entry, filter)) { if (log.isDebugEnabled()) log.debug("Entry being locked did not pass filter (will not lock): " + entry);
if (filter != CU.empty0() && !cctx.isAll(this, filter)) return false;
if (!cctx.isAll(/*version needed for sync evicts*/this, filter)) return false;
if (!cctx.isAll(this, filter)) return new GridCacheUpdateTxResult(false);
if (!cctx.isAll(this, filter)) return new GridCacheUpdateTxResult(false);
if (hasFilters && !cacheCtx.isAll(cached, txEntry.filters())) { if (expiry != null) txEntry.ttl(CU.toTtl(expiry.getExpiryForAccess()));
boolean pass = F.isEmpty(filter) || cacheCtx.isAll(cached, filter);
/** * Same as {@link GridFunc#isAll(Object, IgnitePredicate[])}, but safely unwraps exceptions. * * @param e Element. * @param p Predicates. * @return {@code True} if predicates passed. * @throws IgniteCheckedException If failed. */ public <K1, V1> boolean isAll( GridCacheEntryEx e, @Nullable IgnitePredicate<Cache.Entry<K1, V1>>[] p ) throws IgniteCheckedException { return F.isEmpty(p) || isAll(e.<K1, V1>wrapLazyValue(keepBinary()), p); }
/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(true); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** * @param cached Entry to check. * @return {@code True} if filter passed. */ private boolean filter(GridCacheEntryEx cached) { try { if (!cctx.isAll(cached, filter)) { if (log.isDebugEnabled()) log.debug("Filter didn't pass for entry (will fail lock): " + cached); onFailed(true); return false; } return true; } catch (IgniteCheckedException e) { onError(e); return false; } }
/** {@inheritDoc} */ @Override public void unlockAll( Collection<? extends K> keys ) throws IgniteCheckedException { AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); for (K key : keys) { GridLocalCacheEntry entry = peekExx(ctx.toCacheKeyObject(key)); if (entry != null && ctx.isAll(entry, CU.empty0())) { entry.releaseLocal(); entry.touch(topVer); } } }
/** * Adds local key future. * * @param key Key to add. * @param topVer Topology version. * @param distributedKeys Collection of keys needs to be locked. * @return {@code True} if transaction accesses key that was explicitly locked before. * @throws IgniteCheckedException If lock is externally held and transaction is explicit. */ private boolean addLocalKey( KeyCacheObject key, AffinityTopologyVersion topVer, Collection<KeyCacheObject> distributedKeys ) throws IgniteCheckedException { GridDistributedCacheEntry entry = cctx.colocated().entryExx(key, topVer, false); assert !entry.detached(); if (!cctx.isAll(entry, filter)) { if (log.isDebugEnabled()) log.debug("Entry being locked did not pass filter (will not lock): " + entry); onComplete(false, false); return false; } GridCacheMvccCandidate cand = addEntry(entry); if (cand != null && !cand.reentry()) distributedKeys.add(key); return inTx() && cand == null; }