/** {@inheritDoc} */ @Override public boolean skipStore() { CacheOperationContext prev = gate.enter(opCtx); try { return opCtx != null && opCtx.skipStore(); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<Map<K, V>> op(GridNearTxLocal tx, AffinityTopologyVersion readyTopVer) { return tx.getAllAsync(ctx, readyTopVer, ctx.cacheKeysView(keys), deserializeBinary, skipVals, false, opCtx != null && opCtx.skipStore(), recovery, needVer); } }, opCtx, /*retry*/false);
/** {@inheritDoc} */ @Override public IgniteInternalFuture<Map<K, V>> getAllAsync( @Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable UUID subjId, String taskName, boolean deserializeBinary, boolean recovery, boolean skipVals, boolean needVer ) { CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync(keys, null, opCtx == null || !opCtx.skipStore(), /*don't check local tx. */false, subjId, taskName, deserializeBinary, opCtx != null && opCtx.recovery(), forcePrimary, null, skipVals, needVer); }
@Override public IgniteInternalFuture<V> op(GridNearTxLocal tx, AffinityTopologyVersion readyTopVer) { IgniteInternalFuture<Map<Object, Object>> fut = tx.getAllAsync(ctx, readyTopVer, Collections.singleton(ctx.toCacheKeyObject(key)), deserializeBinary, skipVals, false, opCtx != null && opCtx.skipStore(), recovery, needVer); return fut.chain(new CX1<IgniteInternalFuture<Map<Object, Object>>, V>() { @Override public V applyx(IgniteInternalFuture<Map<Object, Object>> e) throws IgniteCheckedException { Map<Object, Object> map = e.get(); assert map.isEmpty() || map.size() == 1 : map.size(); if (skipVals) { Boolean val = map.isEmpty() ? false : (Boolean)F.firstValue(map); return (V)(val); } return (V)F.firstValue(map); } }); } }, opCtx, /*retry*/false);
/** * @return {@code true} if the skip store flag is set. */ public boolean skipStore() { if (nearContext()) return dht().near().context().skipStore(); CacheOperationContext opCtx = opCtxPerCall.get(); return (opCtx != null && opCtx.skipStore()); }
/** {@inheritDoc} */ @Override public GatewayProtectedCacheProxy<K, V> skipStore() { CacheOperationGate opGate = onEnter(); try { boolean skip = opCtx.skipStore(); if (skip) return this; return new GatewayProtectedCacheProxy<>(delegate, opCtx.setSkipStore(true), lock); } finally { onLeave(opGate); } }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> removeAllAsync() { GridFutureAdapter<Void> opFut = new GridFutureAdapter<>(); AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); CacheOperationContext opCtx = ctx.operationContextPerCall(); removeAllAsync(opFut, topVer, opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary()); return opFut; }
/** {@inheritDoc} */ @Override public GridCacheProxyImpl<K, V> setSkipStore(boolean skipStore) { CacheOperationContext prev = gate.enter(opCtx); try { if (opCtx != null && opCtx.skipStore() == skipStore) return this; return new GridCacheProxyImpl<>(ctx, delegate, opCtx != null ? opCtx.setSkipStore(skipStore) : new CacheOperationContext(true, null, false, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX)); } finally { gate.leave(prev); } }
skipVals ? null : opCtx != null ? opCtx.expiry() : null, skipVals, opCtx != null && opCtx.skipStore(), needVer);
subjId, taskNameHash, opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(),
final boolean skipStore = opCtx != null && opCtx.skipStore(); final boolean recovery = opCtx != null && opCtx.recovery();
/** {@inheritDoc} */ @Override protected IgniteInternalFuture<Boolean> lockAllAsync( Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long createTtl, long accessTtl ) { CacheOperationContext opCtx = ctx.operationContextPerCall(); GridNearLockFuture fut = new GridNearLockFuture(ctx, keys, (GridNearTxLocal)tx, isRead, retval, timeout, createTtl, accessTtl, CU.empty0(), opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery()); fut.map(); return fut; }
final boolean skipStore = opCtx != null && opCtx.skipStore();
final boolean skipStore = opCtx != null && opCtx.skipStore();
ctx.subjectIdPerCall(null, opCtx), ctx.kernalContext().job().currentTaskNameHash(), opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(), ctx.subjectIdPerCall(null, opCtx), ctx.kernalContext().job().currentTaskNameHash(), opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(),
subjId, taskNameHash, opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(),
opCtx == null || !opCtx.skipStore(), forcePrimary , topVer,
/** {@inheritDoc} */ @Override public void removeAll() throws IgniteCheckedException { try { AffinityTopologyVersion topVer; boolean retry; CacheOperationContext opCtx = ctx.operationContextPerCall(); boolean skipStore = opCtx != null && opCtx.skipStore(); boolean keepBinary = opCtx != null && opCtx.isKeepBinary(); do { retry = false; topVer = ctx.affinity().affinityTopologyVersion(); // Send job to all data nodes. Collection<ClusterNode> nodes = ctx.grid().cluster().forDataNodes(name()).nodes(); if (!nodes.isEmpty()) { ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes); retry = !ctx.kernalContext().task().execute( new RemoveAllTask(ctx.name(), topVer, skipStore, keepBinary), null).get(); } } while (ctx.affinity().affinityTopologyVersion().compareTo(topVer) != 0 || retry); } catch (ClusterGroupEmptyCheckedException ignore) { if (log.isDebugEnabled()) log.debug("All remote nodes left while cache remove [cacheName=" + name() + "]"); } }
/** {@inheritDoc} */ @Override public PlatformTarget processOutObject(int type) throws IgniteCheckedException { switch (type) { case OP_WITH_PARTITION_RECOVER: { return copy(rawCache.withPartitionRecover(), keepBinary); } case OP_WITH_KEEP_BINARY: { if (keepBinary) return this; return copy(rawCache.withKeepBinary(), true); } case OP_WITH_NO_RETRIES: { CacheOperationContext opCtx = cache.context().operationContextPerCall(); if (opCtx != null && opCtx.noRetries()) return this; return copy(rawCache.withNoRetries(), keepBinary); } case OP_WITH_SKIP_STORE: { CacheOperationContext opCtx = cache.context().operationContextPerCall(); if (opCtx != null && opCtx.skipStore()) return this; return copy(rawCache.withSkipStore(), keepBinary); } case OP_ITERATOR: { Iterator<Cache.Entry> iter = cache.iterator(); return new PlatformCacheIterator(platformCtx, iter); } } return super.processOutObject(type); }
ctx.toCacheKeyObject(key), topVer, opCtx == null || !opCtx.skipStore(), forcePrimary, subjId,