/** {@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); }
/** {@inheritDoc} */ @Override public GatewayProtectedCacheProxy<K, V> withPartitionRecover() { CacheOperationGate opGate = onEnter(); try { boolean recovery = opCtx.recovery(); if (recovery) return this; return new GatewayProtectedCacheProxy<>(delegate, opCtx.setRecovery(true), lock); } finally { onLeave(opGate); } }
/** {@inheritDoc} */ @Override public final IgniteInternalFuture<V> getForcePrimaryAsync(final K key) { String taskName = ctx.kernalContext().job().currentTaskName(); CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync( Collections.singletonList(key), /*force primary*/true, /*skip tx*/false, null, taskName, true, opCtx != null && opCtx.recovery(), /*skip vals*/false, /*can remap*/false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, V>() { @Override public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException { return e.get().get(key); } }); }
/** {@inheritDoc} */ @Override public final V getForcePrimary(K key) throws IgniteCheckedException { String taskName = ctx.kernalContext().job().currentTaskName(); CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync( F.asList(key), /*force primary*/true, /*skip tx*/false, /*subject id*/null, taskName, /*deserialize cache objects*/true, opCtx != null && opCtx.recovery(), /*skip values*/false, /*need ver*/false).get().get(key); }
opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(), opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES);
/** {@inheritDoc} */ @Override public final IgniteInternalFuture<Map<K, V>> getAllOutTxAsync(Set<? extends K> keys) { String taskName = ctx.kernalContext().job().currentTaskName(); CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/true, null, taskName, !(opCtx != null && opCtx.isKeepBinary()), opCtx != null && opCtx.recovery(), /*skip values*/false, /*need ver*/false); }
final ExpiryPolicy expiryPlc = skipVals ? null : opCtx != null ? opCtx.expiry() : null; final boolean skipStore = opCtx != null && opCtx.skipStore(); final boolean recovery = opCtx != null && opCtx.recovery();
/** {@inheritDoc} */ @Override public final IgniteInternalFuture<Boolean> containsKeysAsync(final Collection<? extends K> keys) { A.notNull(keys, "keys"); CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync( keys, /*force primary*/ !ctx.config().isReadFromBackup(), /*skip tx*/false, /*subj id*/null, /*task name*/null, /*deserialize binary*/false, opCtx != null && opCtx.recovery(), /*skip values*/true, /*need ver*/false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, Boolean>() { @Override public Boolean applyx(IgniteInternalFuture<Map<K, V>> fut) throws IgniteCheckedException { Map<K, V> kvMap = fut.get(); if (keys.size() != kvMap.size()) return false; for (Map.Entry<K, V> entry : kvMap.entrySet()) { if (entry.getValue() == null) return false; } return true; } }); }
/** {@inheritDoc} */ @Override protected Map<K, V> getAll0(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException { CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsyncInternal(keys, !ctx.config().isReadFromBackup(), null, ctx.kernalContext().job().currentTaskName(), deserializeBinary, opCtx != null && opCtx.recovery(), false, needVer, false).get(); }
/** {@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; }
/** * @param keys Keys. * @param deserializeBinary Deserialize binary flag. * @param needVer Need version. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ protected Map<K, V> getAll0(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException { checkJta(); String taskName = ctx.kernalContext().job().currentTaskName(); CacheOperationContext opCtx = ctx.operationContextPerCall(); return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/false, /*subject id*/null, taskName, deserializeBinary, opCtx != null && opCtx.recovery(), /*skip vals*/false, needVer).get(); }
opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(), opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES ); opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(), opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES);
/** * Cache operation. */ protected abstract class AsyncOp<T> { /** Flag to indicate only-one-key operation. */ private final boolean single; /** * */ protected AsyncOp() { single = true; } /** * @param keys Keys involved. */ protected AsyncOp(Collection<?> keys) { single = keys.size() == 1; } /** * @return Flag to indicate only-one-key operation. */ final boolean single() { return single; } /** * @param tx Transaction.
opCtx != null && opCtx.skipStore(), opCtx != null && opCtx.isKeepBinary(), opCtx != null && opCtx.recovery(), opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES);
/** {@inheritDoc} */ @Override public IgniteInternalFuture<Map<K, V>> getAllAsync(@Nullable final Collection<? extends K> keys) { A.notNull(keys, "keys"); final boolean statsEnabled = ctx.statisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; String taskName = ctx.kernalContext().job().currentTaskName(); CacheOperationContext opCtx = ctx.operationContextPerCall(); IgniteInternalFuture<Map<K, V>> fut = getAllAsync( keys, !ctx.config().isReadFromBackup(), /*skip tx*/false, opCtx != null ? opCtx.subjectId() : null, taskName, !(opCtx != null && opCtx.isKeepBinary()), opCtx != null && opCtx.recovery(), /*skip vals*/false, /*need ver*/false); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1<IgniteInternalFuture<Map<K, V>>, Map<K, V>>() { @Override public Map<K, V> applyx(IgniteInternalFuture<Map<K, V>> f) throws IgniteCheckedException { return interceptGet(keys, f.get()); } }); if (statsEnabled) fut.listen(new UpdateGetTimeStatClosure<Map<K, V>>(metrics0(), start)); return fut; }
taskName, !(opCtx != null && opCtx.isKeepBinary()), opCtx != null && opCtx.recovery(), /*skip vals*/false, /*need ver*/true));
/*singleRmv*/false, keepBinary, opCtx != null && opCtx.recovery(), dataCenterId);
false, keepBinary, opCtx != null && opCtx.recovery(), dataCenterId);
taskName, deserializeBinary, opCtx != null && opCtx.recovery(), /*force primary*/false, expiry,