/** {@inheritDoc} */ @Nullable @Override public V localPeek(K key, CachePeekMode... peekModes) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localPeek(key, peekModes); } catch (IgniteException | IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void preloadPartition(int part) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { delegate.preloadPartition(part); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public int localSize(CachePeekMode... peekModes) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localSize(peekModes); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public long localSizeLong(CachePeekMode... peekModes) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localSizeLong(peekModes); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public Iterable<Cache.Entry<K, V>> localEntries(CachePeekMode... peekModes) throws CacheException { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localEntries(peekModes); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public long localSizeLong(int part, CachePeekMode... peekModes) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localSizeLong(part, peekModes); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public boolean localPreloadPartition(int part) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return delegate.localPreloadPartition(part); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> lsnrCfg) { GridCacheContext<K, V> ctx = getContextSafe(); try { ctx.continuousQueries().cancelJCacheQuery(lsnrCfg); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public Iterator<Cache.Entry<K, V>> iterator() { GridCacheContext<K, V> ctx = getContextSafe(); try { return ctx.cache().igniteIterator(); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public IgniteFuture<Void> preloadPartitionAsync(int part) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { return (IgniteFuture<Void>)createFuture(delegate.preloadPartitionAsync(part)); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void localLoadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.localLoadCacheAsync(p, args)); else delegate.localLoadCache(p, args); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void enableStatistics(boolean enabled) { GridCacheContext<K, V> ctx = getContextSafe(); try { ctx.kernalContext().cache().enableStatistics(Collections.singleton(getName()), enabled); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void clearStatistics() { GridCacheContext<K, V> ctx = getContextSafe(); try { ctx.kernalContext().cache().clearStatistics(Collections.singleton(getName())); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> lsnrCfg) { GridCacheContext<K, V> ctx = getContextSafe(); try { CacheOperationContext opCtx = ctx.operationContextPerCall(); ctx.continuousQueries().executeJCacheQuery(lsnrCfg, false, opCtx != null && opCtx.isKeepBinary()); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void removeAll(Set<? extends K> keys) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.removeAllAsync(keys)); else delegate.removeAll(keys); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void clear() { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.clearAsync()); else delegate.clear(); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void put(K key, V val) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(putAsync0(key, val)); else delegate.put(key, val); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void putAll(Map<? extends K, ? extends V> map) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.putAllAsync(map)); else delegate.putAll(map); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void removeAll() { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.removeAllAsync()); else delegate.removeAll(); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void clearAll(Set<? extends K> keys) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.clearAllAsync(keys)); else delegate.clearAll(keys); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }