ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Izhikov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-11677) LOCAL cache on client node can't be created if persistence enabled
Date Wed, 03 Apr 2019 11:29:01 GMT
Nikolay Izhikov created IGNITE-11677:
----------------------------------------

             Summary: LOCAL cache on client node can't be created if persistence enabled
                 Key: IGNITE-11677
                 URL: https://issues.apache.org/jira/browse/IGNITE-11677
             Project: Ignite
          Issue Type: Task
          Components: cache
    Affects Versions: 2.7
            Reporter: Nikolay Izhikov


Reproducer:

{code:java}
/** */
public class LocalCacheWithPersistenceEnabledTest extends GridCommonAbstractTest {
    /** */
    private boolean client = false;

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws
Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        cfg.setClientMode(client);

        cfg.setDataStorageConfiguration(new DataStorageConfiguration()
            .setDataRegionConfigurations(
                new DataRegionConfiguration()
                    .setName("data-region")
                    .setPersistenceEnabled(true)));

        return cfg;
    }

    /** @throws Exception If failed. */
    @Test
    public void testLocalCacheOnClientNodeWithLazyAllocation() throws Exception {
        client = false;

        IgniteEx srv = startGrid(0);

        srv.cluster().active(true);

        awaitPartitionMapExchange();

        client = true;

        IgniteEx clnt = startGrid(1);

        IgniteCache<Integer, String> cache =
            clnt.createCache(new CacheConfiguration<Integer, String>("my-cache")
                .setCacheMode(CacheMode.LOCAL)
                .setDataRegionName("data-region"));

        cache.put(1, "test");

        assertEquals(cache.get(1), "test");
    }

    @Before
    public void before() throws Exception {
        cleanPersistenceDir();
    }
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message