Search in sources :

Example 91 with GridCacheVersion

use of org.apache.ignite.internal.processors.cache.version.GridCacheVersion in project ignite by apache.

the class GridNearReadRepairFuture method fixWithMajority.

/**
 */
public Map<KeyCacheObject, EntryGetResult> fixWithMajority(Collection<KeyCacheObject> inconsistentKeys) throws IgniteCheckedException {
    /**
     */
    class ByteArrayWrapper {

        final byte[] arr;

        /**
         */
        public ByteArrayWrapper(byte[] arr) {
            this.arr = arr;
        }

        /**
         */
        @Override
        public boolean equals(Object o) {
            return Arrays.equals(arr, ((ByteArrayWrapper) o).arr);
        }

        /**
         */
        @Override
        public int hashCode() {
            return Arrays.hashCode(arr);
        }
    }
    Set<KeyCacheObject> irreparableSet = new HashSet<>(inconsistentKeys.size());
    Map<KeyCacheObject, EntryGetResult> fixedMap = new HashMap<>(inconsistentKeys.size());
    for (KeyCacheObject key : inconsistentKeys) {
        Map<T2<ByteArrayWrapper, GridCacheVersion>, T2<EntryGetResult, Integer>> cntMap = new HashMap<>();
        for (GridPartitionedGetFuture<KeyCacheObject, EntryGetResult> fut : futs.values()) {
            if (!fut.keys().contains(key))
                continue;
            EntryGetResult res = fut.result().get(key);
            ByteArrayWrapper wrapped;
            GridCacheVersion ver;
            if (res != null) {
                CacheObject val = res.value();
                wrapped = new ByteArrayWrapper(val.valueBytes(ctx.cacheObjectContext()));
                ver = res.version();
            } else {
                wrapped = new ByteArrayWrapper(null);
                ver = null;
            }
            T2<ByteArrayWrapper, GridCacheVersion> keyVer = new T2<>(wrapped, ver);
            cntMap.putIfAbsent(keyVer, new T2<>(res, 0));
            cntMap.compute(keyVer, (kv, ri) -> new T2<>(ri.getKey(), ri.getValue() + 1));
        }
        int[] sorted = cntMap.values().stream().map(IgniteBiTuple::getValue).sorted(Comparator.reverseOrder()).mapToInt(v -> v).toArray();
        int max = sorted[0];
        assert max > 0;
        if (sorted.length > 1 && sorted[1] == max) {
            // Majority was not found.
            irreparableSet.add(key);
            continue;
        }
        for (Map.Entry<T2<ByteArrayWrapper, GridCacheVersion>, T2<EntryGetResult, Integer>> count : cntMap.entrySet()) if (count.getValue().getValue().equals(max)) {
            fixedMap.put(key, count.getValue().getKey());
            break;
        }
    }
    if (!irreparableSet.isEmpty())
        throwIrreparable(inconsistentKeys, irreparableSet);
    return fixedMap;
}
Also used : Arrays(java.util.Arrays) Collection(java.util.Collection) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) AffinityTopologyVersion(org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion) ReadRepairStrategy(org.apache.ignite.cache.ReadRepairStrategy) EntryGetResult(org.apache.ignite.internal.processors.cache.EntryGetResult) Set(java.util.Set) GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) HashMap(java.util.HashMap) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) T2(org.apache.ignite.internal.util.typedef.T2) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) HashSet(java.util.HashSet) TransactionState(org.apache.ignite.transactions.TransactionState) IgniteInternalTx(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx) Map(java.util.Map) IgniteCacheExpiryPolicy(org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy) GridPartitionedGetFuture(org.apache.ignite.internal.processors.cache.distributed.dht.GridPartitionedGetFuture) Comparator(java.util.Comparator) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) Collections(java.util.Collections) HashMap(java.util.HashMap) GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) EntryGetResult(org.apache.ignite.internal.processors.cache.EntryGetResult) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) HashMap(java.util.HashMap) Map(java.util.Map) T2(org.apache.ignite.internal.util.typedef.T2) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) HashSet(java.util.HashSet)

Example 92 with GridCacheVersion

use of org.apache.ignite.internal.processors.cache.version.GridCacheVersion in project ignite by apache.

the class GridNearTxLocal method loadMissing.

/**
 * @param cacheCtx Cache context.
 * @param keys Keys to load.
 * @param filter Filter.
 * @param ret Return value.
 * @param needReadVer Read version flag.
 * @param singleRmv {@code True} for single remove operation.
 * @param hasFilters {@code True} if filters not empty.
 * @param readThrough Read through flag.
 * @param retval Return value flag.
 * @param expiryPlc Expiry policy.
 * @return Load future.
 */
private IgniteInternalFuture<Void> loadMissing(final GridCacheContext cacheCtx, final AffinityTopologyVersion topVer, final Set<KeyCacheObject> keys, final CacheEntryPredicate[] filter, final GridCacheReturn ret, final boolean needReadVer, final boolean singleRmv, final boolean hasFilters, final boolean readThrough, final boolean retval, final boolean keepBinary, final boolean recovery, final ExpiryPolicy expiryPlc) {
    GridInClosure3<KeyCacheObject, Object, GridCacheVersion> c = new GridInClosure3<KeyCacheObject, Object, GridCacheVersion>() {

        @Override
        public void apply(KeyCacheObject key, @Nullable Object val, @Nullable GridCacheVersion loadVer) {
            if (log.isDebugEnabled())
                log.debug("Loaded value from remote node [key=" + key + ", val=" + val + ']');
            IgniteTxEntry e = entry(new IgniteTxKey(key, cacheCtx.cacheId()));
            assert e != null;
            if (needReadVer) {
                assert loadVer != null;
                e.entryReadVersion(singleRmv && val != null ? SER_READ_NOT_EMPTY_VER : loadVer);
            }
            if (singleRmv) {
                assert !hasFilters && !retval;
                assert val == null || Boolean.TRUE.equals(val) : val;
                ret.set(cacheCtx, null, val != null, keepBinary, U.deploymentClassLoader(cctx.kernalContext(), deploymentLdrId));
            } else {
                CacheObject cacheVal = cacheCtx.toCacheObject(val);
                if (e.op() == TRANSFORM) {
                    GridCacheVersion ver;
                    e.readValue(cacheVal);
                    try {
                        ver = e.cached().version();
                    } catch (GridCacheEntryRemovedException ex) {
                        assert optimistic() : e;
                        if (log.isDebugEnabled())
                            log.debug("Failed to get entry version: [msg=" + ex.getMessage() + ']');
                        ver = null;
                    }
                    addInvokeResult(e, cacheVal, ret, ver);
                } else {
                    boolean success;
                    if (hasFilters) {
                        success = isAll(e.context(), key, cacheVal, filter);
                        if (!success) {
                            e.value(cacheVal, false, false);
                            e.op(READ);
                        }
                    } else
                        success = true;
                    ret.set(cacheCtx, cacheVal, success, keepBinary, U.deploymentClassLoader(cctx.kernalContext(), deploymentLdrId));
                }
            }
        }
    };
    return loadMissing(cacheCtx, topVer, readThrough, /*async*/
    true, keys, /*skipVals*/
    singleRmv, needReadVer, keepBinary, recovery, null, expiryPlc, c);
}
Also used : IgniteTxEntry(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry) GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException) IgniteTxKey(org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) Nullable(org.jetbrains.annotations.Nullable) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridInClosure3(org.apache.ignite.internal.util.lang.GridInClosure3)

Example 93 with GridCacheVersion

use of org.apache.ignite.internal.processors.cache.version.GridCacheVersion in project ignite by apache.

the class GridNearTxLocal method localCacheLoadMissing.

/**
 * @param cacheCtx Cache context.
 * @param readThrough Read through flag.
 * @param async if {@code True}, then loading will happen in a separate thread.
 * @param keys Keys.
 * @param skipVals Skip values flag.
 * @param needVer If {@code true} version is required for loaded values.
 * @param c Closure to be applied for loaded values.
 * @param expiryPlc Expiry policy.
 * @return Future with {@code True} value if loading took place.
 */
private IgniteInternalFuture<Void> localCacheLoadMissing(final GridCacheContext cacheCtx, final AffinityTopologyVersion topVer, final boolean readThrough, boolean async, final Collection<KeyCacheObject> keys, boolean skipVals, boolean needVer, boolean keepBinary, boolean recovery, final ExpiryPolicy expiryPlc, final GridInClosure3<KeyCacheObject, Object, GridCacheVersion> c) {
    assert cacheCtx.isLocal() : cacheCtx.name();
    if (!readThrough || !cacheCtx.readThrough()) {
        for (KeyCacheObject key : keys) c.apply(key, null, SER_READ_EMPTY_ENTRY_VER);
        return new GridFinishedFuture<>();
    }
    try {
        IgniteCacheExpiryPolicy expiryPlc0 = optimistic() ? accessPolicy(cacheCtx, keys) : cacheCtx.cache().expiryPolicy(expiryPlc);
        Map<KeyCacheObject, GridCacheVersion> misses = null;
        for (KeyCacheObject key : keys) {
            while (true) {
                IgniteTxEntry txEntry = entry(cacheCtx.txKey(key));
                GridCacheEntryEx entry = txEntry == null ? cacheCtx.cache().entryEx(key) : txEntry.cached();
                if (entry == null)
                    continue;
                try {
                    EntryGetResult res = entry.innerGetVersioned(null, this, /*update-metrics*/
                    !skipVals, /*event*/
                    !skipVals, null, resolveTaskName(), expiryPlc0, txEntry == null ? keepBinary : txEntry.keepBinary(), null);
                    if (res == null) {
                        if (misses == null)
                            misses = new LinkedHashMap<>();
                        misses.put(key, entry.version());
                    } else
                        c.apply(key, skipVals ? true : res.value(), res.version());
                    break;
                } catch (GridCacheEntryRemovedException ignore) {
                    if (log.isDebugEnabled())
                        log.debug("Got removed entry, will retry: " + key);
                    if (txEntry != null)
                        txEntry.cached(cacheCtx.cache().entryEx(key, topologyVersion()));
                }
            }
        }
        if (misses != null) {
            final Map<KeyCacheObject, GridCacheVersion> misses0 = misses;
            cacheCtx.store().loadAll(this, misses.keySet(), new CI2<KeyCacheObject, Object>() {

                @Override
                public void apply(KeyCacheObject key, Object val) {
                    GridCacheVersion ver = misses0.remove(key);
                    assert ver != null : key;
                    if (val != null) {
                        CacheObject cacheVal = cacheCtx.toCacheObject(val);
                        while (true) {
                            GridCacheEntryEx entry = cacheCtx.cache().entryEx(key, topVer);
                            try {
                                cacheCtx.shared().database().ensureFreeSpace(cacheCtx.dataRegion());
                                EntryGetResult verVal = entry.versionedValue(cacheVal, ver, null, null, null);
                                if (log.isDebugEnabled()) {
                                    log.debug("Set value loaded from store into entry [" + "oldVer=" + ver + ", newVer=" + verVal.version() + ", entry=" + entry + ']');
                                }
                                ver = verVal.version();
                                break;
                            } catch (GridCacheEntryRemovedException ignore) {
                                if (log.isDebugEnabled())
                                    log.debug("Got removed entry, (will retry): " + entry);
                            } catch (IgniteCheckedException e) {
                                // Wrap errors (will be unwrapped).
                                throw new GridClosureException(e);
                            }
                        }
                    } else
                        ver = SER_READ_EMPTY_ENTRY_VER;
                    c.apply(key, val, ver);
                }
            });
            for (KeyCacheObject key : misses0.keySet()) c.apply(key, null, SER_READ_EMPTY_ENTRY_VER);
        }
        return new GridFinishedFuture<>();
    } catch (IgniteCheckedException e) {
        setRollbackOnly();
        return new GridFinishedFuture<>(e);
    }
}
Also used : IgniteTxEntry(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) LinkedHashMap(java.util.LinkedHashMap) GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) GridCacheEntryEx(org.apache.ignite.internal.processors.cache.GridCacheEntryEx) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) EntryGetResult(org.apache.ignite.internal.processors.cache.EntryGetResult) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) IgniteCacheExpiryPolicy(org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy)

Example 94 with GridCacheVersion

use of org.apache.ignite.internal.processors.cache.version.GridCacheVersion in project ignite by apache.

the class GridNearTxLocal method readyNearLock.

/**
 * @param txEntry TX entry.
 * @param dhtVer DHT version.
 * @param pendingVers Pending versions.
 * @param committedVers Committed versions.
 * @param rolledbackVers Rolled back versions.
 */
private void readyNearLock(IgniteTxEntry txEntry, GridCacheVersion dhtVer, Collection<GridCacheVersion> pendingVers, Collection<GridCacheVersion> committedVers, Collection<GridCacheVersion> rolledbackVers) {
    while (true) {
        GridCacheContext cacheCtx = txEntry.cached().context();
        assert cacheCtx.isNear();
        GridDistributedCacheEntry entry = (GridDistributedCacheEntry) txEntry.cached();
        try {
            // Handle explicit locks.
            GridCacheVersion explicit = txEntry.explicitVersion();
            if (explicit == null) {
                entry.readyNearLock(xidVer, dhtVer, committedVers, rolledbackVers, pendingVers);
            }
            break;
        } catch (GridCacheEntryRemovedException ignored) {
            assert entry.obsoleteVersion() != null;
            if (log.isDebugEnabled())
                log.debug("Replacing obsolete entry in remote transaction [entry=" + entry + ", tx=" + this + ']');
            // Replace the entry.
            txEntry.cached(txEntry.context().cache().entryEx(txEntry.key(), topologyVersion()));
        }
    }
}
Also used : GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) GridDistributedCacheEntry(org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)

Example 95 with GridCacheVersion

use of org.apache.ignite.internal.processors.cache.version.GridCacheVersion in project ignite by apache.

the class GridNearTxLocal method loadMissing.

/**
 * @param cacheCtx Cache context.
 * @param readThrough Read through flag.
 * @param async if {@code True}, then loading will happen in a separate thread.
 * @param keys Keys.
 * @param skipVals Skip values flag.
 * @param needVer If {@code true} version is required for loaded values.
 * @param c Closure to be applied for loaded values.
 * @param readRepairStrategy Read Repair strategy.
 * @param expiryPlc Expiry policy.
 * @return Future with {@code True} value if loading took place.
 */
private IgniteInternalFuture<Void> loadMissing(final GridCacheContext cacheCtx, AffinityTopologyVersion topVer, boolean readThrough, boolean async, final Collection<KeyCacheObject> keys, final boolean skipVals, final boolean needVer, boolean keepBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, final ExpiryPolicy expiryPlc, final GridInClosure3<KeyCacheObject, Object, GridCacheVersion> c) {
    IgniteCacheExpiryPolicy expiryPlc0 = optimistic() ? accessPolicy(cacheCtx, keys) : cacheCtx.cache().expiryPolicy(expiryPlc);
    if (cacheCtx.isNear()) {
        return cacheCtx.nearTx().txLoadAsync(this, topVer, keys, readThrough, needVer || !cacheCtx.config().isReadFromBackup() || (optimistic() && serializable() && readThrough), /*deserializeBinary*/
        false, recovery, expiryPlc0, skipVals, needVer).chain(new C1<IgniteInternalFuture<Map<Object, Object>>, Void>() {

            @Override
            public Void apply(IgniteInternalFuture<Map<Object, Object>> f) {
                try {
                    Map<Object, Object> map = f.get();
                    processLoaded(map, keys, needVer, c);
                    return null;
                } catch (Exception e) {
                    setRollbackOnly();
                    throw new GridClosureException(e);
                }
            }
        });
    } else if (cacheCtx.isColocated()) {
        if (readRepairStrategy != null) {
            return new GridNearReadRepairCheckOnlyFuture(cacheCtx, keys, readRepairStrategy, readThrough, taskName, false, recovery, expiryPlc0, skipVals, needVer, true, this).multi().chain((fut) -> {
                try {
                    Map<Object, Object> map = fut.get();
                    processLoaded(map, keys, needVer, c);
                    return null;
                } catch (IgniteConsistencyViolationException e) {
                    for (KeyCacheObject key : keys) // Will be recreated after repair.
                    txState().removeEntry(cacheCtx.txKey(key));
                    throw new GridClosureException(e);
                } catch (Exception e) {
                    setRollbackOnly();
                    throw new GridClosureException(e);
                }
            });
        }
        if (keys.size() == 1) {
            final KeyCacheObject key = F.first(keys);
            return cacheCtx.colocated().loadAsync(key, readThrough, needVer || !cacheCtx.config().isReadFromBackup() || (optimistic() && serializable() && readThrough), topVer, resolveTaskName(), /*deserializeBinary*/
            false, expiryPlc0, skipVals, needVer, /*keepCacheObject*/
            true, recovery, null, label()).chain(new C1<IgniteInternalFuture<Object>, Void>() {

                @Override
                public Void apply(IgniteInternalFuture<Object> f) {
                    try {
                        Object val = f.get();
                        processLoaded(key, val, needVer, skipVals, c);
                        return null;
                    } catch (Exception e) {
                        setRollbackOnly();
                        throw new GridClosureException(e);
                    }
                }
            });
        } else {
            return cacheCtx.colocated().loadAsync(keys, readThrough, needVer || !cacheCtx.config().isReadFromBackup() || (optimistic() && serializable() && readThrough), topVer, resolveTaskName(), /*deserializeBinary*/
            false, recovery, expiryPlc0, skipVals, needVer, /*keepCacheObject*/
            true, label(), null).chain(new C1<IgniteInternalFuture<Map<Object, Object>>, Void>() {

                @Override
                public Void apply(IgniteInternalFuture<Map<Object, Object>> f) {
                    try {
                        Map<Object, Object> map = f.get();
                        processLoaded(map, keys, needVer, c);
                        return null;
                    } catch (Exception e) {
                        setRollbackOnly();
                        throw new GridClosureException(e);
                    }
                }
            });
        }
    } else {
        assert cacheCtx.isLocal();
        return localCacheLoadMissing(cacheCtx, topVer, readThrough, async, keys, skipVals, needVer, keepBinary, recovery, expiryPlc, c);
    }
}
Also used : GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException) GridCacheMvccCandidate(org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate) IgniteTxRollbackCheckedException(org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException) GridFutureAdapter(org.apache.ignite.internal.util.future.GridFutureAdapter) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) GridDistributedTxMapping(org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping) EVT_CACHE_OBJECT_READ(org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ) EntryProcessor(javax.cache.processor.EntryProcessor) Map(java.util.Map) Cache(javax.cache.Cache) IgniteCacheExpiryPolicy(org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy) DELETE(org.apache.ignite.internal.processors.cache.GridCacheOperation.DELETE) GridStringBuilder(org.apache.ignite.internal.util.GridStringBuilder) IgniteInClosure(org.apache.ignite.lang.IgniteInClosure) SER_READ_NOT_EMPTY_VER(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry.SER_READ_NOT_EMPTY_VER) IgniteTxTimeoutCheckedException(org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException) GridToStringExclude(org.apache.ignite.internal.util.tostring.GridToStringExclude) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) MvccSnapshotFuture(org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotFuture) MvccProcessor(org.apache.ignite.internal.processors.cache.mvcc.MvccProcessor) TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) Set(java.util.Set) GridCacheVersionedFuture(org.apache.ignite.internal.processors.cache.GridCacheVersionedFuture) GridDhtTxLocalAdapter(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter) MTC(org.apache.ignite.internal.processors.tracing.MTC) TransactionProxy(org.apache.ignite.internal.processors.cache.transactions.TransactionProxy) TX_NEAR_ENLIST_READ(org.apache.ignite.internal.processors.tracing.SpanType.TX_NEAR_ENLIST_READ) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation) EntryGetResult(org.apache.ignite.internal.processors.cache.EntryGetResult) GridDhtDetachedCacheEntry(org.apache.ignite.internal.processors.cache.distributed.dht.colocated.GridDhtDetachedCacheEntry) U(org.apache.ignite.internal.util.typedef.internal.U) SecurityPermission(org.apache.ignite.plugin.security.SecurityPermission) GridNearReadRepairCheckOnlyFuture(org.apache.ignite.internal.processors.cache.distributed.near.consistency.GridNearReadRepairCheckOnlyFuture) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) COMMITTING(org.apache.ignite.transactions.TransactionState.COMMITTING) ClusterNode(org.apache.ignite.cluster.ClusterNode) CI1(org.apache.ignite.internal.util.typedef.CI1) IgniteInternalTx(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) MvccUtils(org.apache.ignite.internal.processors.cache.mvcc.MvccUtils) S(org.apache.ignite.internal.util.typedef.internal.S) C2(org.apache.ignite.internal.util.typedef.C2) IgniteTxManager(org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager) C1(org.apache.ignite.internal.util.typedef.C1) PREPARED(org.apache.ignite.transactions.TransactionState.PREPARED) ExpiryPolicy(javax.cache.expiry.ExpiryPolicy) MvccCoordinator(org.apache.ignite.internal.processors.cache.mvcc.MvccCoordinator) IgniteTxOptimisticCheckedException(org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException) COMMITTED(org.apache.ignite.transactions.TransactionState.COMMITTED) PREPARING(org.apache.ignite.transactions.TransactionState.PREPARING) IgniteTxEntry(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry) GridNearReadRepairFuture(org.apache.ignite.internal.processors.cache.distributed.near.consistency.GridNearReadRepairFuture) AtomicLong(java.util.concurrent.atomic.AtomicLong) IgniteConsistencyViolationException(org.apache.ignite.internal.processors.cache.distributed.near.consistency.IgniteConsistencyViolationException) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) MvccSnapshot(org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot) CacheEntryPredicate(org.apache.ignite.internal.processors.cache.CacheEntryPredicate) GridDistributedCacheEntry(org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry) GridCacheDrInfo(org.apache.ignite.internal.processors.cache.dr.GridCacheDrInfo) CX1(org.apache.ignite.internal.util.typedef.CX1) IgniteUuid(org.apache.ignite.lang.IgniteUuid) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) TRANSFORM(org.apache.ignite.internal.processors.cache.GridCacheOperation.TRANSFORM) GridInvokeValue(org.apache.ignite.internal.processors.cache.distributed.dht.GridInvokeValue) UNKNOWN(org.apache.ignite.transactions.TransactionState.UNKNOWN) TransactionProxyRollbackOnlyImpl(org.apache.ignite.internal.processors.cache.transactions.TransactionProxyRollbackOnlyImpl) CREATE(org.apache.ignite.internal.processors.cache.GridCacheOperation.CREATE) TX_NEAR_ENLIST_WRITE(org.apache.ignite.internal.processors.tracing.SpanType.TX_NEAR_ENLIST_WRITE) GridDhtTxPrepareFuture(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture) GridInClosure3(org.apache.ignite.internal.util.lang.GridInClosure3) AtomicReferenceFieldUpdater(java.util.concurrent.atomic.AtomicReferenceFieldUpdater) Collection(java.util.Collection) ReadRepairStrategy(org.apache.ignite.cache.ReadRepairStrategy) UUID(java.util.UUID) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) TransactionProxyImpl(org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl) Instant(java.time.Instant) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException) CI2(org.apache.ignite.internal.util.typedef.CI2) GridCacheOperation(org.apache.ignite.internal.processors.cache.GridCacheOperation) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) Nullable(org.jetbrains.annotations.Nullable) NOOP(org.apache.ignite.internal.processors.cache.GridCacheOperation.NOOP) IgniteTxKey(org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey) CU(org.apache.ignite.internal.util.typedef.internal.CU) ACTIVE(org.apache.ignite.transactions.TransactionState.ACTIVE) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridDhtCacheEntry(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry) ROLLING_BACK(org.apache.ignite.transactions.TransactionState.ROLLING_BACK) GridCacheEntryEx(org.apache.ignite.internal.processors.cache.GridCacheEntryEx) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) GridCacheReturn(org.apache.ignite.internal.processors.cache.GridCacheReturn) GridCacheVersion(org.apache.ignite.internal.processors.cache.version.GridCacheVersion) HashMap(java.util.HashMap) IgniteBiClosure(org.apache.ignite.lang.IgniteBiClosure) SER_READ_EMPTY_ENTRY_VER(org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry.SER_READ_EMPTY_ENTRY_VER) HashSet(java.util.HashSet) IgniteClosure(org.apache.ignite.lang.IgniteClosure) IgniteUtils(org.apache.ignite.internal.util.IgniteUtils) CacheException(javax.cache.CacheException) UpdateSourceIterator(org.apache.ignite.internal.processors.query.UpdateSourceIterator) GridLeanMap(org.apache.ignite.internal.util.GridLeanMap) F(org.apache.ignite.internal.util.typedef.F) Iterator(java.util.Iterator) GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) AffinityTopologyVersion(org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion) ClusterTopologyCheckedException(org.apache.ignite.internal.cluster.ClusterTopologyCheckedException) ROLLED_BACK(org.apache.ignite.transactions.TransactionState.ROLLED_BACK) UPDATE(org.apache.ignite.internal.processors.cache.GridCacheOperation.UPDATE) MARKED_ROLLBACK(org.apache.ignite.transactions.TransactionState.MARKED_ROLLBACK) MvccCoordinatorChangeAware(org.apache.ignite.internal.processors.cache.mvcc.MvccCoordinatorChangeAware) GridEmbeddedFuture(org.apache.ignite.internal.util.future.GridEmbeddedFuture) TransactionState(org.apache.ignite.transactions.TransactionState) GridDhtTxFinishFuture(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxFinishFuture) CacheOperationContext(org.apache.ignite.internal.processors.cache.CacheOperationContext) EnlistOperation(org.apache.ignite.internal.processors.query.EnlistOperation) GridPlainRunnable(org.apache.ignite.internal.util.lang.GridPlainRunnable) Collections(java.util.Collections) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException) READ(org.apache.ignite.internal.processors.cache.GridCacheOperation.READ) TraceSurroundings(org.apache.ignite.internal.processors.tracing.MTC.TraceSurroundings) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) IgniteTxRollbackCheckedException(org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException) IgniteTxTimeoutCheckedException(org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteTxOptimisticCheckedException(org.apache.ignite.internal.transactions.IgniteTxOptimisticCheckedException) IgniteConsistencyViolationException(org.apache.ignite.internal.processors.cache.distributed.near.consistency.IgniteConsistencyViolationException) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) CacheException(javax.cache.CacheException) ClusterTopologyCheckedException(org.apache.ignite.internal.cluster.ClusterTopologyCheckedException) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException) C1(org.apache.ignite.internal.util.typedef.C1) GridNearReadRepairCheckOnlyFuture(org.apache.ignite.internal.processors.cache.distributed.near.consistency.GridNearReadRepairCheckOnlyFuture) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridTimeoutObject(org.apache.ignite.internal.processors.timeout.GridTimeoutObject) IgniteConsistencyViolationException(org.apache.ignite.internal.processors.cache.distributed.near.consistency.IgniteConsistencyViolationException) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) GridLeanMap(org.apache.ignite.internal.util.GridLeanMap) IgniteCacheExpiryPolicy(org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject)

Aggregations

GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)247 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)81 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)70 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)60 UUID (java.util.UUID)58 Test (org.junit.Test)58 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)55 GridCacheEntryRemovedException (org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)51 GridCacheEntryEx (org.apache.ignite.internal.processors.cache.GridCacheEntryEx)34 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)32 Map (java.util.Map)30 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)30 ArrayList (java.util.ArrayList)29 ClusterNode (org.apache.ignite.cluster.ClusterNode)26 Collection (java.util.Collection)24 HashMap (java.util.HashMap)24 IgniteException (org.apache.ignite.IgniteException)22 Nullable (org.jetbrains.annotations.Nullable)22 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)21 GridCacheContext (org.apache.ignite.internal.processors.cache.GridCacheContext)20