/** * Called to remove all data from cache without regard to transaction. * * @param cache Cache. * @throws IgniteCheckedException If failed. */ public static void evictAll(IgniteInternalCache<Object, Object> cache) throws IgniteCheckedException { cache.clear(); }
/** {@inheritDoc} */ @Override public void clear(K key) { IgniteInternalCache<K, V> delegate = getDelegateSafe(); try { if (isAsync()) setFuture(delegate.clearAsync(key)); else delegate.clear(key); } 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 clear() throws IgniteCheckedException { delegate.get().clear(); }
/** {@inheritDoc} */ @Override public void clear() { try { if (isAsync()) setFuture(delegate.clearAsync()); else delegate.clear(); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void clear(Object key) throws IgniteCheckedException { delegate.get().clear(keyTransformer.transform(key)); }
/** {@inheritDoc} */ @Override public void clear(K key) { try { if (isAsync()) setFuture(delegate.clearAsync(key)); else delegate.clear(key); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void clear() throws IgniteCheckedException { CacheOperationContext prev = gate.enter(opCtx); try { delegate.clear(); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public void clear(K key) throws IgniteCheckedException { CacheOperationContext prev = gate.enter(opCtx); try { delegate.clear(key); } finally { gate.leave(prev); } }
/** * Success if implicit tx fails. * * @param cache Cache instance. * @throws Exception If failed. */ protected void checkImplicitTxSuccess(final IgniteInternalCache<Object, Object> cache) throws Exception { cache.invoke("key", new EntryProcessor<Object, Object, Object>() { @Override public Object process(final MutableEntry<Object, Object> entry, final Object... args) throws EntryProcessorException { try { sleepForTxFailure(); } catch (InterruptedException e) { throw new EntryProcessorException(e); } return null; } }); cache.clear(); }
/** * Success if explicit tx doesn't fail. * * @param cache Cache instance. * @throws Exception If failed. */ protected void checkStartTxSuccess(final IgniteInternalCache<Object, Object> cache) throws Exception { try (final GridNearTxLocal tx = CU.txStartInternal(cache.context(), cache, PESSIMISTIC, REPEATABLE_READ)) { assert tx != null; sleepForTxFailure(); cache.put("key", "val"); tx.commit(); } assert cache.containsKey("key"); cache.clear(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { for (int i = 0; i < NODES_CNT; i++) { grid(i).cachex(grid(i).igfsx("igfs").configuration().getMetaCacheConfiguration().getName()).clear(); grid(i).cachex(grid(i).igfsx("igfs").configuration().getDataCacheConfiguration().getName()).clear(); } }
/** {@inheritDoc} */ @Override public void clear(K key) throws IgniteCheckedException { CacheOperationContext prev = gate.enter(opCtx); try { delegate.clear(key); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public void clear() throws IgniteCheckedException { CacheOperationContext prev = gate.enter(opCtx); try { delegate.clear(); } finally { gate.leave(prev); } }