/** * @param reqs Cache requests to start. * @param fut Completable future. */ public void registrateProxyRestart(Map<String, DynamicCacheChangeRequest> reqs, GridFutureAdapter<?> fut) { for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (reqs.containsKey(proxy.getName()) && proxy.isRestarting() && !reqs.get(proxy.getName()).disabledAfterStart() ) proxy.registrateFutureRestart(fut); } }
/** * Await proxy initialization. * * @param jcache Cache proxy. */ private void awaitInitializeProxy(IgniteCacheProxyImpl<?, ?> jcache) { if (jcache != null) { CountDownLatch initLatch = jcache.getInitLatch(); try { while (initLatch.getCount() > 0) { initLatch.await(2000, TimeUnit.MILLISECONDS); if (log.isInfoEnabled()) log.info("Failed to wait proxy initialization, cache=" + jcache.getName() + ", localNodeId=" + ctx.localNodeId()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); // Ignore intteruption. } } }
/** * Restarts proxies of caches if they was marked as restarting. Requires external synchronization - shouldn't be * called concurrently with another caches restart. */ public void restartProxies() { for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (proxy == null) continue; GridCacheContext<?, ?> cacheCtx = sharedCtx.cacheContext(CU.cacheId(proxy.getName())); if (cacheCtx == null) continue; if (proxy.isRestarting()) { caches.get(proxy.getName()).active(true); proxy.onRestarted(cacheCtx, cacheCtx.cache()); if (cacheCtx.dataStructuresCache()) ctx.dataStructures().restart(proxy.getName(), proxy.internalProxy()); } } }
/** {@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 enableStatistics(boolean enabled) { GridCacheContext<K, V> ctx = getContextSafe(); try { ctx.kernalContext().cache().enableStatistics(Collections.singleton(getName()), enabled); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** * * @param reqs Cache requests to start. * @param fut Completable future. */ public void registrateProxyRestart(Map<String, DynamicCacheChangeRequest> reqs, GridFutureAdapter<?> fut) { for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (reqs.containsKey(proxy.getName()) && proxy.isRestarting() && !reqs.get(proxy.getName()).disabledAfterStart() ) proxy.registrateFutureRestart(fut); } }
/** {@inheritDoc} */ @Override public void clearStatistics() { try { ctx.kernalContext().cache().clearStatistics(Collections.singleton(getName())); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** {@inheritDoc} */ @Override public void enableStatistics(boolean enabled) { try { ctx.kernalContext().cache().enableStatistics(Collections.singleton(getName()), enabled); } catch (IgniteCheckedException e) { throw cacheException(e); } }
/** * Await proxy initialization. * * @param jcache Cache proxy. */ private void awaitInitializeProxy(IgniteCacheProxyImpl<?, ?> jcache) { if (jcache != null) { CountDownLatch initLatch = jcache.getInitLatch(); try { while (initLatch.getCount() > 0) { initLatch.await(2000, TimeUnit.MILLISECONDS); if (log.isInfoEnabled()) log.info("Failed to wait proxy initialization, cache=" + jcache.getName() + ", localNodeId=" + ctx.localNodeId()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); // Ignore intteruption. } } }
/** * Restarts proxies of caches if they was marked as restarting. Requires external synchronization - shouldn't be * called concurrently with another caches restart. */ public void restartProxies() { for (IgniteCacheProxyImpl<?, ?> proxy : jCacheProxies.values()) { if (proxy == null) continue; GridCacheContext<?, ?> cacheCtx = sharedCtx.cacheContext(CU.cacheId(proxy.getName())); if (cacheCtx == null) continue; if (proxy.isRestarting()) { caches.get(proxy.getName()).active(true); proxy.onRestarted(cacheCtx, cacheCtx.cache()); if (cacheCtx.dataStructuresCache()) ctx.dataStructures().restart(proxy.internalProxy()); } } }