/** * */ public void updateUtilityCache() { serviceCache = ctx.cache().utilityCache(); }
/** {@inheritDoc} */ @Override public void onKernalStart(boolean active) throws IgniteCheckedException { if (!active) return; tasksMetaCache = ctx.security().enabled() && !ctx.isDaemon() ? ctx.cache().<GridTaskNameHashKey, String>utilityCache() : null; startLatch.countDown(); }
/** {@inheritDoc} */ @Override public <K extends GridCacheUtilityKey, V> IgniteInternalCache<K, V> utilityCache() { guard(); try { checkClusterState(); return ctx.cache().utilityCache(); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public Map<UUID, Integer> call() throws Exception { IgniteInternalCache<Object, Object> cache = ignite.context().cache().utilityCache(); if (cache == null) { List<ComputeJobContext> pendingCtxs = ((GridServiceProcessor)ignite.context().service()).pendingJobCtxs; synchronized (pendingCtxs) { // Double check cache reference after lock acqusition. cache = ignite.context().cache().utilityCache(); if (cache == null) { if (!waitedCacheInit) { log.debug("Utility cache hasn't been initialized yet. Waiting."); // waiting for a minute for cache initialization. jCtx.holdcc(60 * 1000); pendingCtxs.add(jCtx); waitedCacheInit = true; return null; } else { log.error("Failed to gather service topology. Utility " + "cache initialization is stuck."); throw new IgniteCheckedException("Failed to gather service topology. Utility " + "cache initialization is stuck."); } } } } return serviceTopology(cache, svcName); } }
/** * @throws Exception If failed. */ @Test public void testGridNearTxLocalDuplicateAsyncCommit() throws Exception { IgniteKernal ignite = (IgniteKernal)grid(0); IgniteInternalCache<Object, Object> utilityCache = ignite.context().cache().utilityCache(); try (GridNearTxLocal itx = MvccFeatureChecker.forcedMvcc() ? utilityCache.txStartEx(PESSIMISTIC, REPEATABLE_READ) : utilityCache.txStartEx(OPTIMISTIC, SERIALIZABLE)) { utilityCache.put("1", "1"); itx.commitNearTxLocalAsync(); itx.commitNearTxLocalAsync().get(); } }
/** * @throws Exception If failed. */ @Test public void testSystemTxInsideUserTx() throws Exception { Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10473", MvccFeatureChecker.forcedMvcc()); IgniteKernal ignite = (IgniteKernal)grid(0); IgniteCache<Object, Object> jcache = ignite.cache(DEFAULT_CACHE_NAME); try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) { jcache.get("1"); jcache.put("1", "11"); IgniteInternalCache<Object, Object> utilityCache = ignite.context().cache().utilityCache(); utilityCache.getAndPutIfAbsent("2", "2"); try (GridNearTxLocal itx = utilityCache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) { assertEquals(null, utilityCache.get("1")); assertEquals("2", utilityCache.get("2")); assertEquals(null, utilityCache.get("3")); utilityCache.getAndPut("3", "3"); itx.commit(); } jcache.put("2", "22"); tx.commit(); } checkTransactionsCommitted(); checkEntries(DEFAULT_CACHE_NAME, "1", "11", "2", "22", "3", null); checkEntries(CU.UTILITY_CACHE_NAME, "1", null, "2", "2", "3", "3"); }
/** * */ public void updateUtilityCache() { serviceCache = ctx.cache().utilityCache(); }
/** {@inheritDoc} */ @Override public void onKernalStart(boolean active) throws IgniteCheckedException { if (!active) return; tasksMetaCache = ctx.security().enabled() && !ctx.isDaemon() ? ctx.cache().<GridTaskNameHashKey, String>utilityCache() : null; startLatch.countDown(); }
/** {@inheritDoc} */ @Override public <K extends GridCacheUtilityKey, V> IgniteInternalCache<K, V> utilityCache() { guard(); try { checkClusterState(); return ctx.cache().utilityCache(); } finally { unguard(); } }
/** {@inheritDoc} */ @Override public Map<UUID, Integer> call() throws Exception { IgniteInternalCache<Object, Object> cache = ignite.context().cache().utilityCache(); if (cache == null) { List<ComputeJobContext> pendingCtxs = ignite.context().service().pendingJobCtxs; synchronized (pendingCtxs) { // Double check cache reference after lock acqusition. cache = ignite.context().cache().utilityCache(); if (cache == null) { if (!waitedCacheInit) { log.debug("Utility cache hasn't been initialized yet. Waiting."); // waiting for a minute for cache initialization. jCtx.holdcc(60 * 1000); pendingCtxs.add(jCtx); waitedCacheInit = true; return null; } else { log.error("Failed to gather service topology. Utility " + "cache initialization is stuck."); throw new IgniteCheckedException("Failed to gather service topology. Utility " + "cache initialization is stuck."); } } } } return serviceTopology(cache, svcName); } }