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());
}
}
Aggregations