Search in sources :

Example 6 with CacheInvokeEntry

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

the class IgniteTxLocalAdapter method addInvokeResult.

/**
 * @param txEntry Entry.
 * @param cacheVal Value.
 * @param ret Return value to update.
 * @param ver Entry version.
 */
protected final void addInvokeResult(IgniteTxEntry txEntry, CacheObject cacheVal, GridCacheReturn ret, GridCacheVersion ver) {
    GridCacheContext ctx = txEntry.context();
    Object key0 = null;
    Object val0 = null;
    try {
        Object res = null;
        for (T2<EntryProcessor<Object, Object, Object>, Object[]> t : txEntry.entryProcessors()) {
            CacheInvokeEntry<Object, Object> invokeEntry = new CacheInvokeEntry<>(txEntry.key(), key0, cacheVal, val0, ver, txEntry.keepBinary(), txEntry.cached());
            EntryProcessor<Object, Object, ?> entryProcessor = t.get1();
            res = entryProcessor.process(invokeEntry, t.get2());
            val0 = invokeEntry.value();
            key0 = invokeEntry.key();
        }
        ctx.validateKeyAndValue(txEntry.key(), ctx.toCacheObject(val0));
        if (res != null)
            ret.addEntryProcessResult(ctx, txEntry.key(), key0, res, null, txEntry.keepBinary());
    } catch (Exception e) {
        ret.addEntryProcessResult(ctx, txEntry.key(), key0, null, e, txEntry.keepBinary());
    }
}
Also used : EntryProcessor(javax.cache.processor.EntryProcessor) GridCacheContext(org.apache.ignite.internal.processors.cache.GridCacheContext) CacheInvokeEntry(org.apache.ignite.internal.processors.cache.CacheInvokeEntry) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) GridCacheFilterFailedException(org.apache.ignite.internal.processors.cache.GridCacheFilterFailedException) IgniteTxRollbackCheckedException(org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException) IgniteTxTimeoutCheckedException(org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) TransactionDeadlockException(org.apache.ignite.transactions.TransactionDeadlockException) StorageException(org.apache.ignite.internal.pagemem.wal.StorageException) GridCacheEntryRemovedException(org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) GridCacheIndexUpdateException(org.apache.ignite.internal.processors.cache.GridCacheIndexUpdateException) IgniteTxHeuristicCheckedException(org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException) GridClosureException(org.apache.ignite.internal.util.lang.GridClosureException)

Aggregations

EntryProcessor (javax.cache.processor.EntryProcessor)6 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)6 CacheInvokeEntry (org.apache.ignite.internal.processors.cache.CacheInvokeEntry)6 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)6 GridCacheEntryRemovedException (org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)6 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)6 ArrayList (java.util.ArrayList)3 GridCacheContext (org.apache.ignite.internal.processors.cache.GridCacheContext)3 GridCacheOperation (org.apache.ignite.internal.processors.cache.GridCacheOperation)3 IgniteTxTimeoutCheckedException (org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException)3 LinkedHashMap (java.util.LinkedHashMap)2 ExpiryPolicy (javax.cache.expiry.ExpiryPolicy)2 IgniteException (org.apache.ignite.IgniteException)2 NodeStoppingException (org.apache.ignite.internal.NodeStoppingException)2 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)2 StorageException (org.apache.ignite.internal.pagemem.wal.StorageException)2 CacheInvokeResult (org.apache.ignite.internal.processors.cache.CacheInvokeResult)2 CacheLazyEntry (org.apache.ignite.internal.processors.cache.CacheLazyEntry)2 CacheStorePartialUpdateException (org.apache.ignite.internal.processors.cache.CacheStorePartialUpdateException)2 GridCacheEntryEx (org.apache.ignite.internal.processors.cache.GridCacheEntryEx)2