/** * Tests preset eviction policy. * * @throws Exception If failed. */ private void checkPolicy0() throws Exception { for (TransactionConcurrency concurrency : TransactionConcurrency.values()) { txConcurrency = concurrency; for (TransactionIsolation isolation : TransactionIsolation.values()) { txIsolation = isolation; Ignite g = startGrids(); IgniteCache<String, String> cache = g.cache(null); try { info( ">>> Checking policy [txConcurrency=" + txConcurrency + ", txIsolation=" + txIsolation + ", plc=" + plc + ", nearPlc=" + nearPlc + ']'); checkExplicitTx(g, cache); checkImplicitTx(cache); } finally { stopAllGrids(); } } } }
/** * @param g Grid. * @throws Exception If failed. */ private void checkNodes(Ignite g) throws Exception { IgniteCache<String, String> cache = g.cache("test"); for (char c = 'a'; c <= 'z'; c++) { String key = Character.toString(c); cache.put(key, "val-" + key); String v1 = cache.get(key); String v2 = cache.get(key); // Get second time. info("v1: " + v1); info("v2: " + v2); assertNotNull(v1); assertNotNull(v2); if (affinity(cache).mapKeyToNode(key).isLocal()) assertSame(v1, v2); else assertEquals(v1, v2); } }