/** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> putAsync(Object key, Object val) { return delegate.get().putAsync(keyTransformer.transform(key), val); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> putAsync(K key, V val) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.putAsync(key, val); } finally { gate.leave(prev); } }
/** * Put async internal operation implementation. * * @param key Key. * @param val Value. * @return Internal future. */ private IgniteInternalFuture<Void> putAsync0(K key, V val) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); IgniteInternalFuture<Boolean> fut = delegate.putAsync(key, val); return fut.chain(new CX1<IgniteInternalFuture<Boolean>, Void>() { @Override public Void applyx(IgniteInternalFuture<Boolean> fut1) throws IgniteCheckedException { try { fut1.get(); } catch (RuntimeException e) { throw new GridClosureException(e); } return null; } }); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { if (ttl != null && ttl > 0) { Duration duration = new Duration(MILLISECONDS, ttl); c = c.withExpiryPolicy(new ModifiedExpiryPolicy(duration)); } return c.putAsync(key, val); } }
/** * Put async internal operation implementation. * * @param key Key. * @param val Value. * @return Internal future. */ private IgniteInternalFuture<Void> putAsync0(K key, V val) { IgniteInternalFuture<Boolean> fut = delegate.putAsync(key, val); return fut.chain(new CX1<IgniteInternalFuture<Boolean>, Void>() { @Override public Void applyx(IgniteInternalFuture<Boolean> fut1) throws IgniteCheckedException { try { fut1.get(); } catch (RuntimeException e) { throw new GridClosureException(e); } return null; } }); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> putAsync(K key, V val) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.putAsync(key, val); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { if (ttl != null && ttl > 0) { Duration duration = new Duration(MILLISECONDS, ttl); c = c.withExpiryPolicy(new ModifiedExpiryPolicy(duration)); } return c.putAsync(key, val); } }