Search in sources :

Example 31 with IgniteTxKey

use of org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey in project ignite by apache.

the class GridNearTxPrepareResponse method prepareMarshal.

/** {@inheritDoc}
     * @param ctx*/
@Override
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
    super.prepareMarshal(ctx);
    if (ownedVals != null && ownedValKeys == null) {
        ownedValKeys = ownedVals.keySet();
        ownedValVals = ownedVals.values();
        for (Map.Entry<IgniteTxKey, CacheVersionedValue> entry : ownedVals.entrySet()) {
            GridCacheContext cacheCtx = ctx.cacheContext(entry.getKey().cacheId());
            entry.getKey().prepareMarshal(cacheCtx);
            entry.getValue().prepareMarshal(cacheCtx.cacheObjectContext());
        }
    }
    if (retVal != null && retVal.cacheId() != 0) {
        GridCacheContext cctx = ctx.cacheContext(retVal.cacheId());
        assert cctx != null : retVal.cacheId();
        retVal.prepareMarshal(cctx);
    }
    if (filterFailedKeys != null) {
        for (IgniteTxKey key : filterFailedKeys) {
            GridCacheContext cctx = ctx.cacheContext(key.cacheId());
            key.prepareMarshal(cctx);
        }
    }
}
Also used : GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) IgniteTxKey(org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

IgniteTxKey (org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey)31 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)16 GridCacheEntryRemovedException (org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)14 GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)14 IgniteTxEntry (org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry)13 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)11 GridCacheContext (org.apache.ignite.internal.processors.cache.GridCacheContext)11 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)9 Map (java.util.Map)7 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)7 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)7 GridCacheEntryEx (org.apache.ignite.internal.processors.cache.GridCacheEntryEx)7 IgniteTxRollbackCheckedException (org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException)6 ArrayList (java.util.ArrayList)5 GridCacheMvccCandidate (org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate)5 HashMap (java.util.HashMap)4 ClusterNode (org.apache.ignite.cluster.ClusterNode)4 GridDistributedCacheEntry (org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry)4 EntryGetResult (org.apache.ignite.internal.processors.cache.EntryGetResult)3 GridCacheEntryInfo (org.apache.ignite.internal.processors.cache.GridCacheEntryInfo)3