Java Code Examples for org.apache.ignite.Ignite#cache()

The following examples show how to use org.apache.ignite.Ignite#cache() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IgnteCacheClientWriteBehindStoreAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testClientWithoutStore() throws Exception {
    Ignite client = grid(2);

    assertTrue(client.configuration().isClientMode());

    IgniteCache<Integer, Integer> cache = client.cache(DEFAULT_CACHE_NAME);

    assertNull(cache.getConfiguration(CacheConfiguration.class).getCacheStoreFactory());

    for (int i = 0; i < 1000; i++)
        cache.put(i, i);

    GridTestUtils.waitForCondition(new GridAbsPredicate() {
        @Override public boolean apply() {
            return storeMap.size() == 1000;
        }
    }, 5000);

    assertEquals(1000, storeMap.size());
}
 
Example 2
Source File: IgniteWalReaderTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * Puts provided number of records to fill WAL under transactions.
 *
 * @param ignite ignite instance.
 * @param recordsToWrite count.
 * @param txCnt transactions to run. If number is less then records count, txCnt records will be written.
 */
private IgniteCache<Object, Object> txPutDummyRecords(Ignite ignite, int recordsToWrite, int txCnt) {
    IgniteCache<Object, Object> cache0 = ignite.cache(CACHE_NAME);
    int keysPerTx = recordsToWrite / txCnt;
    if (keysPerTx == 0)
        keysPerTx = 1;
    for (int t = 0; t < txCnt; t++) {
        try (Transaction tx = ignite.transactions().txStart()) {
            for (int i = t * keysPerTx; i < (t + 1) * keysPerTx; i++)
                cache0.put(i, new IndexedObject(i));

            tx.commit();
        }
    }
    return cache0;
}
 
Example 3
Source File: IgniteDynamicCacheStartNoExchangeTimeoutTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @param name Cache name.
 */
private void checkCache(@NotNull String name) {
    int key = 0;

    for (Ignite ignite : G.allGrids()) {
        IgniteCache<Object, Object> cache = ignite.cache(name);

        assertNotNull(cache);

        for (int i = 0; i < 100; i++) {
            cache.put(key, key);

            assertEquals(key, cache.get(key));

            key++;
        }
    }
}
 
Example 4
Source File: IgniteCacheConfigVariationsFullApiTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @param concurrency Concurrency.
 * @throws Exception If failed.
 */
private void checkPeekTxRemove(TransactionConcurrency concurrency) throws Exception {
    if (txShouldBeUsed()) {
        Ignite ignite = primaryIgnite("key");
        IgniteCache<String, Integer> cache = ignite.cache(cacheName());

        cache.put("key", 1);

        try (Transaction tx = ignite.transactions().txStart(concurrency, READ_COMMITTED)) {
            cache.remove("key");

            assertNull(cache.get("key")); // localPeek ignores transactions.
            assertNotNull(cache.localPeek("key")); // localPeek ignores transactions.

            tx.commit();
        }
    }
}
 
Example 5
Source File: IgniteDbPutGetAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @param total Expected total entries.
 */
private void checkScan(int total) {
    for (int i = 0; i < gridCount(); i++) {
        Set<DbKey> allKeys = new HashSet<>();

        Ignite ignite0 = grid(i);

        IgniteCache<DbKey, DbValue> cache0 = ignite0.cache("non-primitive");

        ScanQuery<DbKey, DbValue> qry = new ScanQuery<>();

        QueryCursor<Cache.Entry<DbKey, DbValue>> cur = cache0.query(qry);

        for (Cache.Entry<DbKey, DbValue> e : cur) {
            allKeys.add(e.getKey());
            assertEquals(e.getKey().val, e.getValue().iVal);
        }

        assertEquals(total, allKeys.size());
    }
}
 
Example 6
Source File: CacheAffinityExample.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * Collocates jobs with keys they need to work on using
 * {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)} method.
 */
private static void visitUsingAffinityRun() {
    Ignite ignite = Ignition.ignite();

    final IgniteCache<Integer, String> cache = ignite.cache(CACHE_NAME);

    for (int i = 0; i < KEY_CNT; i++) {
        int key = i;

        // This runnable will execute on the remote node where
        // data with the given key is located. Since it will be co-located
        // we can use local 'peek' operation safely.
        ignite.compute().affinityRun(CACHE_NAME, key,
            () -> System.out.println("Co-located using affinityRun [key= " + key + ", value=" + cache.localPeek(key) + ']'));
    }
}
 
Example 7
Source File: LongIndexNameTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 *
 */
@NotNull private IgniteCache insertSomeData(Ignite ignite) {
    if (!ignite.active())
        ignite.active(true);

    IgniteCache<String, Person> cache = ignite.cache("cache");

    for (int i = 0; i < 10; i++)
        cache.put(String.valueOf(System.currentTimeMillis()), new Person("Name " + i, i));

    return cache;
}
 
Example 8
Source File: GridCacheDhtPreloadMessageCountTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testAutomaticPreload() throws Exception {
    Ignite g0 = startGrid(0);

    int cnt = KEY_CNT;

    IgniteCache<String, Integer> c0 = g0.cache(DEFAULT_CACHE_NAME);

    for (int i = 0; i < cnt; i++)
        c0.put(Integer.toString(i), i);

    Ignite g1 = startGrid(1);
    Ignite g2 = startGrid(2);

    U.sleep(1000);

    IgniteCache<String, Integer> c1 = g1.cache(DEFAULT_CACHE_NAME);
    IgniteCache<String, Integer> c2 = g2.cache(DEFAULT_CACHE_NAME);

    TestRecordingCommunicationSpi spi0 = (TestRecordingCommunicationSpi)g0.configuration().getCommunicationSpi();
    TestRecordingCommunicationSpi spi1 = (TestRecordingCommunicationSpi)g1.configuration().getCommunicationSpi();
    TestRecordingCommunicationSpi spi2 = (TestRecordingCommunicationSpi)g2.configuration().getCommunicationSpi();

    info(spi0.recordedMessages(false).size() + " " +
        spi1.recordedMessages(false).size() + " " +
        spi2.recordedMessages(false).size());

    checkCache(c0, cnt);
    checkCache(c1, cnt);
    checkCache(c2, cnt);
}
 
Example 9
Source File: SqlSystemViewsSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param ignite Ignite.
 * @param sql Sql.
 * @param args Args.
 */
@SuppressWarnings("unchecked")
private List<List<?>> execSql(Ignite ignite, String sql, Object... args) {
    IgniteCache cache = ignite.cache(DEFAULT_CACHE_NAME);

    SqlFieldsQuery qry = new SqlFieldsQuery(sql);

    if (args != null && args.length > 0)
        qry.setArgs(args);

    return cache.query(qry).getAll();
}
 
Example 10
Source File: CacheMvccSqlUpdateCountersTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Checks update counter value on all nodes.
 *
 * @param cacheName Cache name.
 * @param p Part number.
 * @param val Expected partition counter value.
 */
private void checkUpdateCounters(String cacheName, int p, long val) {
    for (Ignite node : G.allGrids()) {
        if (!node.configuration().isClientMode()) {
            IgniteCacheProxy cache = (IgniteCacheProxy)node.cache(cacheName);

            GridDhtLocalPartition part = cache.context().topology().localPartition(p);

            if (!cache.context().mvccEnabled() || part == null)
                continue;

            assertEquals("part=" + p, val, part.updateCounter());
        }
    }
}
 
Example 11
Source File: GridCacheOffheapUpdateSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testReadEvictedPartition() throws Exception {
    try {
        Ignite grid = startGrid(0);

        IgniteCache<Object, Object> cache = grid.cache(DEFAULT_CACHE_NAME);

        for (int i = 0; i < 30; i++)
            cache.put(i, 0);

        startGrid(1);

        awaitPartitionMapExchange();

        for (int i = 0; i < 30; i++)
            grid(1).cache(DEFAULT_CACHE_NAME).put(i, 10);

        // Find a key that does not belong to started node anymore.
        int key = 0;

        ClusterNode locNode = grid.cluster().localNode();

        for (;key < 30; key++) {
            if (!grid.affinity(DEFAULT_CACHE_NAME).isPrimary(locNode, key) && !grid.affinity(DEFAULT_CACHE_NAME).isBackup(locNode, key))
                break;
        }

        assertEquals(10, cache.get(key));

        if (((IgniteCacheProxy)cache).context().config().getAtomicityMode() != CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT) {
            try (Transaction ignored = grid.transactions().txStart(OPTIMISTIC, REPEATABLE_READ)) {
                assertEquals(10, cache.get(key));
            }

            try (Transaction ignored = grid.transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
                assertEquals(10, cache.get(key));
            }
        }
        else {
            try (Transaction ignored = grid.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                assertEquals(10, cache.get(key));
            }
        }
    }
    finally {
        stopAllGrids();
    }
}
 
Example 12
Source File: GridCacheNearMetricsSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testCreateReadRemoveInvokesFromNear() throws Exception {
    Ignite g0 = grid(0);

    IgniteCache<Integer, Integer> cache0 = g0.cache(DEFAULT_CACHE_NAME);

    int key;

    for (int i = 0; ; i++) {
        if (!affinity(cache0).isPrimaryOrBackup(g0.cluster().localNode(), i)) {
            setValue1ByEntryProcessor(cache0, i);

            readKeyByEntryProcessor(cache0, i);

            removeKeyByEntryProcessor(cache0, i);

            key = i;

            break;
        }
    }

    for (int j = 0; j < gridCount(); j++) {
        Ignite g = grid(j);

        IgniteCache<Object, Object> jcache = g.cache(DEFAULT_CACHE_NAME);

        assertEquals(1, jcache.localMetrics().getEntryProcessorPuts());
        assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals());
        assertEquals(1, jcache.localMetrics().getEntryProcessorMisses());

        if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
            assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations());
            assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals());
            assertEquals(3, jcache.localMetrics().getEntryProcessorInvocations());

            assertEquals(2, jcache.localMetrics().getEntryProcessorHits());

            assertEquals((float) 1 / 3 * 100.0f, jcache.localMetrics().getEntryProcessorMissPercentage(), 0.001f);
            assertEquals((float) 2 / 3 * 100.0f, jcache.localMetrics().getEntryProcessorHitPercentage(), 0.001f);
        } else {
            assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations());
            assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals());
            assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations());

            assertEquals(1, jcache.localMetrics().getEntryProcessorHits());

            assertEquals(50.0f, jcache.localMetrics().getEntryProcessorMissPercentage(), 0.001f);
            assertEquals(50.0f, jcache.localMetrics().getEntryProcessorHitPercentage(), 0.001f);
        }
    }
}
 
Example 13
Source File: GridCacheLocalMultithreadedSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
    Ignite ignite = grid();

    cache = ignite.cache(DEFAULT_CACHE_NAME);
}
 
Example 14
Source File: CacheMvccSqlTxQueriesAbstractTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testQueryUpdateSubquery() throws Exception {
    ccfg = cacheConfiguration(cacheMode(), FULL_SYNC, 2, DFLT_PARTITION_COUNT)
        .setIndexedTypes(Integer.class, Integer.class, Integer.class, MvccTestSqlIndexValue.class);

    startGridsMultiThreaded(4);

    awaitPartitionMapExchange();

    Random rnd = ThreadLocalRandom.current();

    Ignite checkNode = grid(rnd.nextInt(4));
    Ignite updateNode = grid(rnd.nextInt(4));

    IgniteCache cache = checkNode.cache(DEFAULT_CACHE_NAME);

    cache.putAll(F.asMap(
        1, new MvccTestSqlIndexValue(1),
        2, new MvccTestSqlIndexValue(2),
        3, new MvccTestSqlIndexValue(3)));

    try (Transaction tx = updateNode.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
        tx.timeout(TX_TIMEOUT);

        SqlFieldsQuery qry = new SqlFieldsQuery("UPDATE MvccTestSqlIndexValue AS t " +
            "SET (idxVal1) = (SELECT idxVal1*10 FROM MvccTestSqlIndexValue WHERE t._key = _key)");

        IgniteCache<Object, Object> cache0 = updateNode.cache(DEFAULT_CACHE_NAME);

        try (FieldsQueryCursor<List<?>> cur = cache0.query(qry)) {
            assertEquals(3L, cur.iterator().next().get(0));
        }

        tx.commit();
    }

    assertEquals(10, ((MvccTestSqlIndexValue)cache.get(1)).idxVal1);
    assertEquals(20, ((MvccTestSqlIndexValue)cache.get(2)).idxVal1);
    assertEquals(30, ((MvccTestSqlIndexValue)cache.get(3)).idxVal1);
}
 
Example 15
Source File: CacheMetricsManageTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 *
 */
@Test
public void testPublicApiStatisticsEnable() throws Exception {
    Ignite ig1 = startGrid(1);
    startGrid(2);

    IgniteCache<Object, Object> cache1 = ig1.cache(CACHE1);

    CacheConfiguration<Object, Object> cacheCfg2 = new CacheConfiguration<Object, Object>(cache1.getConfiguration(CacheConfiguration.class));

    cacheCfg2.setName(CACHE2);
    cacheCfg2.setStatisticsEnabled(true);

    ig1.getOrCreateCache(cacheCfg2);

    assertCachesStatisticsMode(false, true);

    cache1.enableStatistics(true);

    assertCachesStatisticsMode(true, true);

    ig1.cluster().enableStatistics(Arrays.asList(CACHE1, CACHE2), false);

    assertCachesStatisticsMode(false, false);
}
 
Example 16
Source File: CacheMvccReplicatedSqlTxQueriesTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 *
 * @throws Exception If failed.
 */
@Test
public void testReplicatedAndPartitionedUpdateSingleTransaction() throws Exception {
    ccfgs = new CacheConfiguration[] {
        cacheConfiguration(REPLICATED, FULL_SYNC, 0, DFLT_PARTITION_COUNT)
            .setName("rep")
            .setIndexedTypes(Integer.class, Integer.class),
        cacheConfiguration(PARTITIONED, FULL_SYNC, 0, DFLT_PARTITION_COUNT)
            .setIndexedTypes(Integer.class, MvccTestSqlIndexValue.class)
            .setName("part"),
    };

    startGridsMultiThreaded(3);

    client = true;

    startGrid(3);

    Random rnd = ThreadLocalRandom.current();

    Ignite node = grid(rnd.nextInt(4));

    List<List<?>> r;

    Cache<Integer, Integer> repCache = node.cache("rep");

    repCache.put(1, 1);
    repCache.put(2, 2);
    repCache.put(3, 3);

    Cache<Integer, MvccTestSqlIndexValue> partCache = node.cache("part");

    partCache.put(1, new MvccTestSqlIndexValue(1));
    partCache.put(2, new MvccTestSqlIndexValue(2));
    partCache.put(3, new MvccTestSqlIndexValue(3));

    try (Transaction tx = node.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
        tx.timeout(TX_TIMEOUT);

        r = runSql(node, "UPDATE \"rep\".Integer SET _val = _key * 10");

        assertEquals(3L, r.get(0).get(0));

        r = runSql(node, "UPDATE  \"part\".MvccTestSqlIndexValue SET idxVal1 = _key * 10");

        assertEquals(3L, r.get(0).get(0));

        tx.commit();
    }

    r = runSql(node, "SELECT COUNT(1) FROM \"rep\".Integer r JOIN \"part\".MvccTestSqlIndexValue p" +
        " ON r._key = p._key WHERE r._val = p.idxVal1");

    assertEquals(3L, r.get(0).get(0));

    for (int n = 0; n < 3; ++n) {
        node = grid(n);

        r = runSqlLocal(node, "SELECT _key, _val FROM \"rep\".Integer ORDER BY _key");

        assertEquals(3L, r.size());

        assertEquals(1, r.get(0).get(0));
        assertEquals(2, r.get(1).get(0));
        assertEquals(3, r.get(2).get(0));

        assertEquals(10, r.get(0).get(1));
        assertEquals(20, r.get(1).get(1));
        assertEquals(30, r.get(2).get(1));
    }
}
 
Example 17
Source File: CacheGroupsMetricsRebalanceTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testRebalance() throws Exception {
    Ignite ignite = startGrids(4);

    IgniteCache<Object, Object> cache1 = ignite.cache(CACHE1);
    IgniteCache<Object, Object> cache2 = ignite.cache(CACHE2);

    for (int i = 0; i < KEYS_COUNT; i++) {
        cache1.put(i, CACHE1 + "-" + i);

        if (i % 2 == 0)
            cache2.put(i, CACHE2 + "-" + i);
    }

    final CountDownLatch l1 = new CountDownLatch(1);
    final CountDownLatch l2 = new CountDownLatch(1);

    startGrid(4).events().localListen(new IgnitePredicate<Event>() {
        @Override public boolean apply(Event evt) {
            l1.countDown();

            try {
                assertTrue(l2.await(5, TimeUnit.SECONDS));
            }
            catch (InterruptedException e) {
                throw new AssertionError();
            }

            return false;
        }
    }, EventType.EVT_CACHE_REBALANCE_STOPPED);

    assertTrue(l1.await(5, TimeUnit.SECONDS));

    ignite = ignite(4);

    CacheMetrics metrics1 = ignite.cache(CACHE1).localMetrics();
    CacheMetrics metrics2 = ignite.cache(CACHE2).localMetrics();

    l2.countDown();

    long rate1 = metrics1.getRebalancingKeysRate();
    long rate2 = metrics2.getRebalancingKeysRate();

    assertTrue(rate1 > 0);
    assertTrue(rate2 > 0);

    // rate1 has to be roughly the same as rate2
    double ratio = ((double)rate2 / rate1);

    log.info("Ratio: " + ratio);

    assertTrue(ratio > 0.9 && ratio < 1.1);
}
 
Example 18
Source File: BinaryTypeMismatchLoggingTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * @throws Exception In case of an error.
 */
@Test
public void testEntryWriteCreateTable() throws Exception {
    Ignite ignite = startGridWithLogCapture();

    IgniteCache def = ignite.createCache("default");

    def.query(new SqlFieldsQuery("CREATE TABLE binary (id INT PRIMARY KEY, str VARCHAR) " +
        "WITH \"cache_name=binary, key_type=IdKey, value_type=Payload\"").setSchema("PUBLIC"));

    IgniteCache<Integer, Payload> binary = ignite.cache("binary");
    binary.put(1, new Payload("foo"));
    binary.put(2, new Payload("bar"));

    assertEquals(0, countRows(binary));

    assertContainsExactlyOnce(capture.toString(), MESSAGE_PAYLOAD_VALUE);

    capture.reset();

    def.query(new SqlFieldsQuery("CREATE TABLE binary2 (id INT PRIMARY KEY, str VARCHAR) " +
        "WITH \"cache_name=binary2, key_type=IdKey, value_type=Payload\"").setSchema("PUBLIC"));

    IgniteCache<Integer, Payload> binary2 = ignite.cache("binary2");
    binary2.put(1, new Payload("foo"));
    binary2.put(2, new Payload("bar"));

    assertEquals(0, countRows(binary2));

    assertContainsExactlyOnce(capture.toString(), MESSAGE_PAYLOAD_VALUE);
}
 
Example 19
Source File: GridCacheAtomicNearCacheSelfTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@SuppressWarnings("ZeroLengthArrayAllocation")
private void checkReaderRemove() throws Exception {
    Ignite ignite0 = grid(0);

    IgniteCache<Integer, Integer> cache0 = ignite0.cache(DEFAULT_CACHE_NAME);

    Affinity<Integer> aff = ignite0.affinity(DEFAULT_CACHE_NAME);

    UUID id0 = ignite0.cluster().localNode().id();

    Integer nearKey = key(ignite0, NOT_PRIMARY_AND_BACKUP);

    cache0.put(nearKey, 1); // Put should create near entry on grid0.

    for (int i = 0; i < GRID_CNT; i++) {
        UUID[] expReaders = aff.isPrimary(grid(i).localNode(), nearKey) ? new UUID[] {id0} : new UUID[] {};

        checkEntry(grid(i), nearKey, 1, i == 0, expReaders);
    }

    cache0.remove(nearKey); // Remove from grid0, this should remove readers on primary node.

    for (int i = 0; i < GRID_CNT; i++)
        checkEntry(grid(i), nearKey, null, i == 0);

    Ignite primaryNode = G.ignite((String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME));

    IgniteCache<Integer, Integer> primaryCache = primaryNode.cache(DEFAULT_CACHE_NAME);

    primaryCache.put(nearKey, 2); // Put from primary, check there are no readers.

    checkEntry(primaryNode, nearKey, 2, false);
}
 
Example 20
Source File: IgniteUidAsConsistentIdMigrationTest.java    From ignite with Apache License 2.0 2 votes vote down vote up
/**
 * Test start two nodes with predefined conistent ID (emulate old fashion node). Then restart two nodes. Expected
 * both nodes will get its own old folders
 *
 * @throws Exception if failed.
 */
@Test
public void testStartTwoOldStyleNodes() throws Exception {
    final String expDfltConsistentId1 = "127.0.0.1:47500";

    this.configuredConsistentId = expDfltConsistentId1; //this is for create old node folder
    final Ignite ignite = startGrid(0);

    final String expDfltConsistentId2 = "127.0.0.1:47501";

    this.configuredConsistentId = expDfltConsistentId2; //this is for create old node folder
    final Ignite ignite2 = startGrid(1);

    ignite.active(true);

    final String expVal = "there is compatible mode with old style folders!";

    ignite2.getOrCreateCache(CACHE_NAME).put("hi", expVal);

    assertPdsDirsDefaultExist(U.maskForFileName(expDfltConsistentId1));
    assertPdsDirsDefaultExist(U.maskForFileName(expDfltConsistentId2));
    stopAllGrids();

    this.configuredConsistentId = null; //now set up grid on existing folder

    final Ignite igniteRestart = startGrid(0);
    final Ignite igniteRestart2 = startGrid(1);

    igniteRestart2.active(true);

    assertEquals(expDfltConsistentId1, igniteRestart.cluster().localNode().consistentId());
    assertEquals(expDfltConsistentId2, igniteRestart2.cluster().localNode().consistentId());

    final IgniteCache<Object, Object> cache = igniteRestart.cache(CACHE_NAME);

    assertNotNull("Expected to have cache [" + CACHE_NAME + "] using [" + expDfltConsistentId1 + "] as PDS folder", cache);
    final Object valFromCache = cache.get("hi");

    assertNotNull("Expected to load data from cache using [" + expDfltConsistentId1 + "] as PDS folder", valFromCache);
    assertTrue(expVal.equals(valFromCache));

    assertNodeIndexesInFolder(); //no new style nodes should be found
    stopGrid(0);
}