/** {@inheritDoc} */ @Override public IgniteFuture<?> destroyAsync() { GridCacheContext<K, V> ctx = getContextSafe(); return new IgniteFutureImpl<>(ctx.kernalContext().cache().dynamicDestroyCache(cacheName, false, true, false, null)); }
@Override public Object call() throws Exception { futs.add(kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME, false, true, false, null)); return null; } }, threadNum, "cache-stopper");
@Override public Object call() throws Exception { IgniteEx kernal = grid(ThreadLocalRandom.current().nextInt(nodeCount())); futs.add(kernal.context().cache().dynamicDestroyCache(DYNAMIC_CACHE_NAME, false, true, false, null)); return null; } }, threadNum, "cache-stopper");
/** * @param cacheName Cache name to close. * @return Future that will be completed when cache is closed. */ IgniteInternalFuture<?> dynamicCloseCache(String cacheName) { assert cacheName != null; IgniteCacheProxy<?, ?> proxy = jcacheProxy(cacheName, false); if (proxy == null || proxy.isProxyClosed()) return new GridFinishedFuture<>(); // No-op. checkEmptyTransactions(); if (proxy.context().isLocal()) return dynamicDestroyCache(cacheName, false, true, false, null); return startClientCacheChange(null, Collections.singleton(cacheName)); }
/** * @param cacheName Cache name. * @param sql If the cache needs to be destroyed only if it was created by SQL {@code CREATE TABLE} command. * @param checkThreadTx If {@code true} checks that current thread does not have active transactions. * @return Ignite future. */ public IgniteInternalFuture<Boolean> destroyCacheAsync(String cacheName, boolean sql, boolean checkThreadTx) { CU.validateCacheName(cacheName); guard(); try { checkClusterState(); return ctx.cache().dynamicDestroyCache(cacheName, sql, checkThreadTx, false, null); } finally { unguard(); } }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { ((IgniteEx)ignite(0)).context().cache().dynamicDestroyCache(DEFAULT_CACHE_NAME, true, true, false, null); if (conn != null) { conn.close(); assertTrue(conn.isClosed()); } cleanUpWorkingDir(); }
/** * Destroy SQL cache on given node. * @param node Node to create cache on. */ protected void destroySqlCache(Ignite node) throws IgniteCheckedException { ((IgniteEx)node).context().cache().dynamicDestroyCache(CACHE_NAME, true, true, false, null).get(); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { node().context().cache().dynamicDestroyCache(CACHE_NAME, true, true, false, null).get(); super.afterTest(); }
/** {@inheritDoc} */ @Override public void close() { IgniteFuture<Boolean> destroyFut = null; gate.enter(); try { delegate.close(); if (delegate.separated()) { IgniteInternalFuture<Boolean> fut = cctx.kernalContext().cache().dynamicDestroyCache( cctx.cache().name(), false, true, false, null); ((GridFutureAdapter)fut).ignoreInterrupts(); destroyFut = new IgniteFutureImpl<>(fut); } } finally { gate.leave(); } if (destroyFut != null) destroyFut.get(); }
kernal.context().cache().dynamicDestroyCache(ccfg.getName(), false, true, true, restartId) .get(getTestTimeout(), TimeUnit.MILLISECONDS);
/** {@inheritDoc} */ @Override public IgniteFuture<?> destroyAsync() { return new IgniteFutureImpl<>(ctx.kernalContext().cache().dynamicDestroyCache(ctx.name(), false, true, false)); }
/** * @param cacheName Cache name to close. * @return Future that will be completed when cache is closed. */ IgniteInternalFuture<?> dynamicCloseCache(String cacheName) { assert cacheName != null; IgniteCacheProxy<?, ?> proxy = jcacheProxy(cacheName, false); if (proxy == null || proxy.isProxyClosed()) return new GridFinishedFuture<>(); // No-op. checkEmptyTransactions(); if (proxy.context().isLocal()) return dynamicDestroyCache(cacheName, false, true, false); return startClientCacheChange(null, Collections.singleton(cacheName)); }
/** * @param cacheName Cache name. * @param sql If the cache needs to be destroyed only if it was created by SQL {@code CREATE TABLE} command. * @param checkThreadTx If {@code true} checks that current thread does not have active transactions. * @return Ignite future. */ public IgniteInternalFuture<Boolean> destroyCacheAsync(String cacheName, boolean sql, boolean checkThreadTx) { CU.validateCacheName(cacheName); guard(); try { checkClusterState(); return ctx.cache().dynamicDestroyCache(cacheName, sql, checkThreadTx, false); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public void close() { IgniteFuture<Boolean> destroyFut = null; gate.enter(); try { delegate.close(); if (delegate.separated()) { IgniteInternalFuture<Boolean> fut = cctx.kernalContext().cache().dynamicDestroyCache( cctx.cache().name(), false, true, false); ((GridFutureAdapter)fut).ignoreInterrupts(); destroyFut = new IgniteFutureImpl<>(fut); } } finally { gate.leave(); } if (destroyFut != null) destroyFut.get(); }