/** * Enable WAL. * * @param node Node. * @param cacheName Cache name. * @return Result. */ protected boolean walEnable(Ignite node, String cacheName) { return node.cluster().enableWal(cacheName); }
/** * Check concurrent operations. * * @param done Done flag. * @param node Node. */ private static void checkConcurrentOperations(AtomicBoolean done, Ignite node) { ThreadLocalRandom rnd = ThreadLocalRandom.current(); boolean state = rnd.nextBoolean(); while (!done.get()) { if (state) node.cluster().enableWal(CACHE_NAME); else node.cluster().disableWal(CACHE_NAME); state = !state; } try { Thread.sleep(rnd.nextLong(200, 1000)); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
cli.cluster().disableWal(CACHE_NAME); else cli.cluster().enableWal(CACHE_NAME);
try { if (state) cli.cluster().enableWal(CACHE_NAME); else cli.cluster().disableWal(CACHE_NAME);
try { if (state) cli.cluster().enableWal(CACHE_NAME); else cli.cluster().disableWal(CACHE_NAME);
boolean res = cluster.enableWal(tbl.cacheName());
/** * @throws Exception If failed. */ @Test public void testLocalAndGlobalWalStateInterdependence() throws Exception { Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10421", MvccFeatureChecker.forcedMvcc()); Ignite ignite = startGrids(3); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < getKeysCount(); k++) cache.put(k, k); IgniteEx newIgnite = startGrid(3); newIgnite.cluster().setBaselineTopology(ignite.cluster().nodes()); awaitExchange(newIgnite); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); assertFalse(grpCtx.walEnabled()); ignite.cluster().disableWal(DEFAULT_CACHE_NAME); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).rebalance(); awaitPartitionMapExchange(); assertFalse(grpCtx.walEnabled()); // WAL is globally disabled ignite.cluster().enableWal(DEFAULT_CACHE_NAME); assertTrue(grpCtx.walEnabled()); }
assertEquals(cache2.size(), 30); srv.cluster().enableWal(CACHE_NAME);
boolean res = cluster.enableWal(tbl.cacheName());