/** {@inheritDoc} */ @Override public IgniteInternalFuture<EntryProcessorResult> invokeAsync( Object key, EntryProcessor entryProcessor, Object... args ) { return delegate.get().invokeAsync(keyTransformer.transform(key), entryProcessor, args); }
/** {@inheritDoc} */ @Override public <T> IgniteInternalFuture<EntryProcessorResult<T>> invokeAsync(K key, EntryProcessor<K, V, T> entryProcessor, Object... args) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.invokeAsync(key, entryProcessor, args); } finally { gate.leave(prev); } }
/** * @param jobId Job id. * @param c Closure of operation. */ private void transform(HadoopJobId jobId, EntryProcessor<HadoopJobId, HadoopJobMetadata, Void> c) { jobMetaCache().invokeAsync(jobId, c).listen(failsLog); }
/** * Invoke async operation internal implementation. * * @param key Key. * @param entryProcessor Processor. * @param args Arguments. * @return Internal future. */ private <T> IgniteInternalFuture<T> invokeAsync0(K key, EntryProcessor<K, V, T> entryProcessor, Object[] args) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); IgniteInternalFuture<EntryProcessorResult<T>> fut = delegate.invokeAsync(key, entryProcessor, args); return fut.chain(new CX1<IgniteInternalFuture<EntryProcessorResult<T>>, T>() { @Override public T applyx(IgniteInternalFuture<EntryProcessorResult<T>> fut1) throws IgniteCheckedException { try { return fut1.get().get(); } catch (RuntimeException e) { throw new GridClosureException(e); } } }); }
IgniteInternalCache<HadoopJobId, HadoopJobMetadata> cache = finishedJobMetaCache(); cache.invokeAsync(info.jobId(), new UpdatePhaseProcessor(incrCntrs, PHASE_COMPLETE)). listen(failsLog);
/** * @throws Exception If failed. */ @Test public void testInternalInvokeNullable() throws Exception { IgniteInternalCache<Integer, Integer> cache = grid(0).cachex(DEFAULT_CACHE_NAME); EntryProcessor<Integer, Integer, Void> processor = new NullableProcessor(); for (final Integer key : keys()) { log.info("Test invoke with a nullable result [key=" + key + ']'); EntryProcessorResult<Void> result = cache.invoke(key, processor); EntryProcessorResult<Void> resultAsync = cache.invokeAsync(key, processor).get(); assertNotNull(result); assertNotNull(resultAsync); assertNull(result.get()); assertNull(resultAsync.get()); } }
/** {@inheritDoc} */ @Override public <T> IgniteInternalFuture<EntryProcessorResult<T>> invokeAsync(K key, EntryProcessor<K, V, T> entryProcessor, Object... args) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.invokeAsync(key, entryProcessor, args); } finally { gate.leave(prev); } }
/** * Invoke async operation internal implementation. * * @param key Key. * @param entryProcessor Processor. * @param args Arguments. * @return Internal future. */ private <T> IgniteInternalFuture<T> invokeAsync0(K key, EntryProcessor<K, V, T> entryProcessor, Object[] args) { IgniteInternalFuture<EntryProcessorResult<T>> fut = delegate.invokeAsync(key, entryProcessor, args); return fut.chain(new CX1<IgniteInternalFuture<EntryProcessorResult<T>>, T>() { @Override public T applyx(IgniteInternalFuture<EntryProcessorResult<T>> fut1) throws IgniteCheckedException { try { return fut1.get().get(); } catch (RuntimeException e) { throw new GridClosureException(e); } } }); }