/** * @return Operation context. */ public CacheOperationContext setAllowAtomicOpsInTx() { return new CacheOperationContext( skipStore, subjId, keepBinary, expiryPlc, noRetries, dataCenterId, recovery, true); }
/** * @param dataCenterId Data center id. * @return Operation context. */ public CacheOperationContext setDataCenterId(byte dataCenterId) { return new CacheOperationContext( skipStore, subjId, keepBinary, expiryPlc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** * See {@link IgniteInternalCache#withExpiryPolicy(ExpiryPolicy)}. * * @param plc {@link ExpiryPolicy} to associate with this projection. * @return New instance of CacheOperationContext with skip store flag. */ public CacheOperationContext withExpiryPolicy(ExpiryPolicy plc) { return new CacheOperationContext( skipStore, subjId, keepBinary, plc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** * See {@link IgniteInternalCache#setSkipStore(boolean)}. * * @param skipStore Skip store flag. * @return New instance of CacheOperationContext with skip store flag. */ public CacheOperationContext setSkipStore(boolean skipStore) { return new CacheOperationContext( skipStore, subjId, keepBinary, expiryPlc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** * @param noRetries No retries flag. * @return Operation context. */ public CacheOperationContext setNoRetries(boolean noRetries) { return new CacheOperationContext( skipStore, subjId, keepBinary, expiryPlc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** * @param recovery Recovery flag. * @return New instance of CacheOperationContext with recovery flag. */ public CacheOperationContext setRecovery(boolean recovery) { return new CacheOperationContext( skipStore, subjId, keepBinary, expiryPlc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** * See {@link IgniteInternalCache#keepBinary()}. * * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( skipStore, subjId, true, expiryPlc, noRetries, dataCenterId, recovery, allowAtomicOpsInTx); }
/** {@inheritDoc} */ @Override public IgniteCacheProxy<K, V> cacheNoGate() { return new GatewayProtectedCacheProxy<>(this, new CacheOperationContext(), false); }
/** * @return Default cached proxy wrapper {@link GatewayProtectedCacheProxy}. */ public IgniteCacheProxy<K, V> gatewayWrapper() { if (cachedProxy != null) return cachedProxy; cachedProxy = new GatewayProtectedCacheProxy<>(this, new CacheOperationContext(), true); return cachedProxy; }
/** {@inheritDoc} */ @Override public final IgniteInternalCache<K, V> withAllowAtomicOpsInTx() { CacheOperationContext opCtx = new CacheOperationContext( false, null, false, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>(ctx, this, opCtx); }
/** {@inheritDoc} */ @Override public final IgniteInternalCache<K, V> withNoRetries() { CacheOperationContext opCtx = new CacheOperationContext( false, null, false, null, true, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>(ctx, this, opCtx); }
/** {@inheritDoc} */ @Override public final GridCacheProxyImpl<K, V> forSubjectId(UUID subjId) { CacheOperationContext opCtx = new CacheOperationContext( false, subjId, false, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>(ctx, this, opCtx); }
/** {@inheritDoc} */ @Override public final <K1, V1> GridCacheProxyImpl<K1, V1> keepBinary() { CacheOperationContext opCtx = new CacheOperationContext( false, null, true, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, (GridCacheAdapter<K1, V1>)this, opCtx); }
/** {@inheritDoc} */ @Override public GridCacheProxyImpl<K, V> forSubjectId(UUID subjId) { return new GridCacheProxyImpl<>(ctx, delegate, opCtx != null ? opCtx.forSubjectId(subjId) : new CacheOperationContext(false, subjId, false, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX)); }
/** {@inheritDoc} */ @Override public final GridCacheProxyImpl<K, V> setSkipStore(boolean skipStore) { CacheOperationContext opCtx = new CacheOperationContext( true, null, false, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>(ctx, this, opCtx); }
/** {@inheritDoc} */ @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl<K1, V1>)this; return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, (GridCacheAdapter<K1, V1>)delegate, opCtx != null ? opCtx.keepBinary() : new CacheOperationContext(false, null, true, null, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX)); }
/** {@inheritDoc} */ @Override public IgniteInternalCache<K, V> withNoRetries() { CacheOperationContext prev = gate.enter(opCtx); try { return new GridCacheProxyImpl<>(ctx, delegate, new CacheOperationContext(false, null, false, null, true, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX)); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public GridCacheProxyImpl<K, V> withExpiryPolicy(ExpiryPolicy plc) { CacheOperationContext prev = gate.enter(opCtx); try { return new GridCacheProxyImpl<>(ctx, delegate, opCtx != null ? opCtx.withExpiryPolicy(plc) : new CacheOperationContext(false, null, false, plc, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX)); } finally { gate.leave(prev); } }
/** {@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); } }
/** {@inheritDoc} */ @Override public final GridCacheProxyImpl<K, V> withExpiryPolicy(ExpiryPolicy plc) { assert !CU.isUtilityCache(ctx.name()); CacheOperationContext opCtx = new CacheOperationContext( false, null, false, plc, false, null, false, DFLT_ALLOW_ATOMIC_OPS_IN_TX); return new GridCacheProxyImpl<>(ctx, this, opCtx); }