Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setConsistentId()

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration#setConsistentId() . 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: IgnitePdsCacheStartStopWithFreqCheckpointTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration dsCfg = new DataStorageConfiguration()
        .setWalMode(WALMode.LOG_ONLY)
        .setCheckpointFrequency(1000)
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(512 * 1024 * 1024)
                .setPersistenceEnabled(true)
        );

    cfg.setDataStorageConfiguration(dsCfg);

    CacheConfiguration[] ccfgs = new CacheConfiguration[CACHES];

    for (int i = 0; i < ccfgs.length; i++)
        ccfgs[i] = cacheConfiguration(i);

    cfg.setCacheConfiguration(ccfgs);

    return cfg;
}
 
Example 2
Source File: IgnitePersistentStoreCacheGroupsTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setConsistentId(gridName);

    DataStorageConfiguration memCfg = new DataStorageConfiguration()
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration().setMaxSize(100L * 1024 * 1024).setPersistenceEnabled(true))
        .setPageSize(1024)
        .setWalMode(WALMode.LOG_ONLY);

    cfg.setDataStorageConfiguration(memCfg);

    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));

    if (ccfgs != null) {
        cfg.setCacheConfiguration(ccfgs);

        ccfgs = null;
    }

    return cfg;
}
 
Example 3
Source File: IgniteCacheQueryNodeRestartSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.setConsistentId(igniteInstanceName);

    CacheConfiguration<?, ?> cc = defaultCacheConfiguration();

    cc.setCacheMode(PARTITIONED);
    cc.setBackups(1);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc.setAtomicityMode(TRANSACTIONAL);
    cc.setRebalanceMode(SYNC);
    cc.setAffinity(new RendezvousAffinityFunction(false, 15));
    cc.setIndexedTypes(
        Integer.class, Integer.class
    );

    c.setCacheConfiguration(cc);
    c.setIncludeEventTypes(EventType.EVTS_ALL);

    return c;
}
 
Example 4
Source File: IgniteChangeGlobalStateAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @param cnt Count.
 * @throws Exception If failed.
 */
private void startBackUpClientNodes(int cnt) throws Exception {
    for (int i = 0; i < cnt; i++) {
        String node = "node" + i;

        String name = node + backUpSuffix + clientSuffix;

        IgniteConfiguration cfg = getConfiguration(name);
        cfg.setConsistentId(node);
        cfg.setActiveOnStart(false);
        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(backUpIpFinder);

        Ignite ig = startClientGrid(name, cfg);

        nodes.put(name, ig);
    }
}
 
Example 5
Source File: WalPreloadingConcurrentTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setConsistentId(gridName);

    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
        .setRebalanceMode(CacheRebalanceMode.ASYNC)
        .setCacheMode(CacheMode.REPLICATED);

    cfg.setCacheConfiguration(ccfg);

    DataStorageConfiguration dbCfg = new DataStorageConfiguration()
        .setWalMode(WALMode.LOG_ONLY)
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setPersistenceEnabled(true)
        );

    cfg.setDataStorageConfiguration(dbCfg);

    return cfg;
}
 
Example 6
Source File: SlowHistoricalRebalanceSmallHistoryTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);

    cfg.setConsistentId(name);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setWalHistorySize(WAL_HISTORY_SIZE)
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE)
                    .setPersistenceEnabled(true)
            )
            .setWalSegmentSize(512 * 1024)
    );

    cfg.setFailureHandler(new StopNodeFailureHandler());

    cfg.setCommunicationSpi(new RebalanceBlockingSPI());

    return cfg;
}
 
Example 7
Source File: CheckpointFreeListTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration storageCfg = new DataStorageConfiguration();

    storageCfg.setCheckpointThreads(2);
    storageCfg.getDefaultDataRegionConfiguration()
        .setPersistenceEnabled(true)
        .setMaxSize(300L * 1024 * 1024);

    cfg.setDataStorageConfiguration(storageCfg)
        .setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER))
        .setCacheConfiguration(cacheConfiguration(CACHE_NAME, CacheAtomicityMode.TRANSACTIONAL));

    return cfg;
}
 
Example 8
Source File: WalOnNodeStartTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setWalSegments(3)
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setMaxSize(50 * 1024 * 1024)
                    .setPersistenceEnabled(true)
            )
    );

    return cfg;
}
 
Example 9
Source File: RowCountTableStatisticsSurvivesNodeRestartTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration memCfg = new DataStorageConfiguration()
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setPersistenceEnabled(true)
        );

    cfg.setDataStorageConfiguration(memCfg);

    return cfg;
}
 
Example 10
Source File: IgnitePdsCorruptedStoreTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConnectorConfiguration(new ConnectorConfiguration());

    cfg.setConsistentId(igniteInstanceName);

    failingFileIOFactory = new FailingFileIOFactory();

    DataStorageConfiguration memCfg = new DataStorageConfiguration()
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(100 * 1024 * 1024)
                .setPersistenceEnabled(true)
        )
        .setWalMode(WALMode.FSYNC)
        .setFileIOFactory(failingFileIOFactory);

    cfg.setDataStorageConfiguration(memCfg);

    cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME1), cacheConfiguration(CACHE_NAME2));

    failureHnd = new DummyFailureHandler();

    cfg.setFailureHandler(failureHnd);

    return cfg;
}
 
Example 11
Source File: CacheBaselineTopologyTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    if (disableAutoActivation)
        cfg.setAutoActivationEnabled(false);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration().setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setPersistenceEnabled(true)
                .setMaxSize(100L * 1024 * 1024)
                .setInitialSize(100L * 1024 * 1024)
        )
        .setDataRegionConfigurations(
            new DataRegionConfiguration()
            .setName("memory")
            .setPersistenceEnabled(false)
            .setMaxSize(100L * 1024 * 1024)
            .setInitialSize(100L * 1024 * 1024)
        )
        .setWalMode(WALMode.LOG_ONLY)
    );

    if (userAttrs != null)
        cfg.setUserAttributes(userAttrs);

    return cfg;
}
 
Example 12
Source File: IgniteWalRebalanceTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    System.setProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD, "0"); //to make all rebalance wal-based

    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setConsistentId(gridName);

    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(CACHE_NAME)
        .setAtomicityMode(CacheAtomicityMode.ATOMIC)
        .setRebalanceMode(CacheRebalanceMode.ASYNC)
        .setCacheMode(CacheMode.PARTITIONED)
        .setBackups(backups)
        .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT));

    cfg.setCacheConfiguration(ccfg);

    DataStorageConfiguration dbCfg = new DataStorageConfiguration()
        .setWalSegmentSize(4 * 1024 * 1024)
        .setWalHistorySize(Integer.MAX_VALUE)
        .setWalMode(WALMode.LOG_ONLY)
        .setCheckpointFrequency(15 * 60 * 1000)
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setPersistenceEnabled(true)
                .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE)
        );

    cfg.setDataStorageConfiguration(dbCfg);

    cfg.setCommunicationSpi(new WalRebalanceCheckingCommunicationSpi());

    if (blockMessagePredicate != null) {
        TestRecordingCommunicationSpi spi = (TestRecordingCommunicationSpi) cfg.getCommunicationSpi();

        spi.blockMessages(blockMessagePredicate);
    }

    return cfg;
}
 
Example 13
Source File: TxWithKeyContentionSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);

    cfg.setConsistentId("NODE_" + name.substring(name.length() - 1));

    if (client)
        cfg.setClientMode(true);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setMaxSize(20 * 1024 * 1024)
            )
    );

    TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi();

    cfg.setCommunicationSpi(commSpi);

    cfg.setCacheConfiguration(getCacheConfiguration(DEFAULT_CACHE_NAME));

    if (client) {
        cfg.setConsistentId("Client");

        cfg.setClientMode(client);
    }

    return cfg;
}
 
Example 14
Source File: IgnitePdsPartitionFilesDestroyTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration dsCfg = new DataStorageConfiguration()
        .setWalMode(WALMode.LOG_ONLY)
        .setCheckpointFrequency(10 * 60 * 1000)
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(512 * 1024 * 1024)
                .setPersistenceEnabled(true)
        );

    if (failFileIo)
        dsCfg.setFileIOFactory(new FailingFileIOFactory(new RandomAccessFileIOFactory()));

    cfg.setDataStorageConfiguration(dsCfg);

    CacheConfiguration ccfg = defaultCacheConfiguration()
        .setBackups(1)
        .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
        .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT));

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example 15
Source File: IgnitePdsDiskErrorsRecoveringTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration dsCfg = new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(
                    new DataRegionConfiguration().setMaxSize(100L * 1024 * 1024).setPersistenceEnabled(true))
            .setWalMode(WALMode.LOG_ONLY)
            .setWalCompactionEnabled(false)
            .setWalSegmentSize(WAL_SEGMENT_SIZE)
            .setCheckpointFrequency(240 * 60 * 1000)
            .setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);

    if (ioFactory != null)
        dsCfg.setFileIOFactory(ioFactory);

    cfg.setDataStorageConfiguration(dsCfg);

    CacheConfiguration cacheCfg = new CacheConfiguration(CACHE_NAME)
        .setRebalanceMode(CacheRebalanceMode.NONE)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
        .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
        .setAffinity(new RendezvousAffinityFunction(false, 1));

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
Example 16
Source File: CommonPoolStarvationCheckpointTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setConsistentId(gridName);

    DataStorageConfiguration memCfg = new DataStorageConfiguration()
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(200L * 1024 * 1024)
                .setPersistenceEnabled(true))
        .setCheckpointFrequency(Long.MAX_VALUE / 2)
        .setPageSize(PAGE_SIZE)
        .setWalMode(WALMode.LOG_ONLY);

    cfg.setDataStorageConfiguration(memCfg);

    CacheConfiguration ccfg = new CacheConfiguration();

    ccfg.setName(CACHE_NAME);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example 17
Source File: IgnitePdsCacheWalDisabledOnRebalancingTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    // This is required because some tests do full clearing of persistence folder losing BLT info on next join.
    cfg.setConsistentId(igniteInstanceName);

    CacheConfiguration ccfg1 = new CacheConfiguration(CACHE1_NAME)
        .setAtomicityMode(CacheAtomicityMode.ATOMIC)
        .setCacheMode(CacheMode.REPLICATED)
        .setAffinity(new RendezvousAffinityFunction(false, CACHE1_PARTS_NUM));

    CacheConfiguration ccfg2 = new CacheConfiguration(CACHE2_NAME)
        .setBackups(1)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
        .setCacheMode(CacheMode.PARTITIONED)
        .setAffinity(new RendezvousAffinityFunction(false, CACHE2_PARTS_NUM));

    CacheConfiguration ccfg3 = new CacheConfiguration(CACHE3_NAME)
        .setBackups(2)
        .setAtomicityMode(CacheAtomicityMode.ATOMIC)
        .setCacheMode(CacheMode.PARTITIONED)
        .setAffinity(new RendezvousAffinityFunction(false, CACHE3_PARTS_NUM));

    cfg.setCacheConfiguration(ccfg1, ccfg2, ccfg3);

    if (!"client".equals(igniteInstanceName)) {
        DataStorageConfiguration dsCfg = new DataStorageConfiguration()
            .setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4)
            .setWalMode(WALMode.LOG_ONLY)
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setMaxSize(256 * 1024 * 1024));

        if (useBlockingFileIO)
            dsCfg.setFileIOFactory(new BlockingCheckpointFileIOFactory());

        cfg.setDataStorageConfiguration(dsCfg);
    }

    TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi();
    commSpi.blockMessages(blockMessagePredicate);

    cfg.setCommunicationSpi(commSpi);

    return cfg;
}
 
Example 18
Source File: IgniteChangeGlobalStateAbstractTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @param cnt Count.
 * @throws Exception If failed.
 */
void startPrimaryClientNodes(int cnt) throws Exception {
    for (int i = 0; i < cnt; i++) {
        String node = "node" + i;

        String name = node + primarySuffix + clientSuffix;

        IgniteConfiguration cfg = getConfiguration(name);

        cfg.setConsistentId(node);

        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(primaryIpFinder);

        Ignite ig = startClientGrid(name, cfg);

        nodes.put(name, ig);
    }
}
 
Example 19
Source File: RebuildIndexWithHistoricalRebalanceTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setConsistentId(gridName);
    cfg.setGridLogger(log);

    QueryEntity qryEntity = new QueryEntity();
    qryEntity.setKeyType(UserKey.class.getName());
    qryEntity.setValueType(UserValue.class.getName());
    qryEntity.setKeyFields(new HashSet<>(Arrays.asList("account")));

    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("account", "java.lang.Integer");
    fields.put("balance", "java.lang.Integer");
    qryEntity.setFields(fields);

    QueryIndex idx1 = new QueryIndex();
    idx1.setName("IDX_1");
    idx1.setIndexType(QueryIndexType.SORTED);
    LinkedHashMap<String, Boolean> idxFields = new LinkedHashMap<>();
    idxFields.put("account", false);
    idxFields.put("balance", false);
    idx1.setFields(idxFields);

    QueryIndex idx2 = new QueryIndex();
    idx2.setName("IDX_2");
    idx2.setIndexType(QueryIndexType.SORTED);
    idxFields = new LinkedHashMap<>();
    idxFields.put("balance", false);
    idx2.setFields(idxFields);

    qryEntity.setIndexes(Arrays.asList(idx1, idx2));

    cfg.setCacheConfiguration(new CacheConfiguration<UserKey, UserValue>()
        .setName(CACHE_NAME)
        .setBackups(2)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
        .setCacheMode(REPLICATED)
        .setWriteSynchronizationMode(FULL_SYNC)
        .setOnheapCacheEnabled(true)
        .setEvictionPolicy(new FifoEvictionPolicy(1000))
        .setAffinity(new RendezvousAffinityFunction(false, 1))
        .setQueryEntities(Collections.singleton(qryEntity)));

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setInitialSize(200L * 1024 * 1024)
                    .setMaxSize(200L * 1024 * 1024)
            )
    );

    cfg.setCommunicationSpi(new RebalanceBlockingSPI());

    return cfg;
}
 
Example 20
Source File: CachePartitionLossWithRestartsTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setActiveOnStart(false);

    cfg.setConsistentId(igniteInstanceName);

    if (getTestIgniteInstanceIndex(igniteInstanceName) == clientIdx)
        cfg.setClientMode(true);

    cfg.setIncludeEventTypes(EventType.EVTS_ALL);

    DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    dsCfg.setWalSegmentSize(4 * 1024 * 1024);
    dsCfg.setWalMode(WALMode.LOG_ONLY);

    final int size = 50 * 1024 * 1024;

    DataRegionConfiguration dfltRegCfg = new DataRegionConfiguration();
    dfltRegCfg.setName(DEFAULT_CACHE_NAME).setInitialSize(size).setMaxSize(size).setPersistenceEnabled(dfltRegionPersistence);

    dsCfg.setDefaultDataRegionConfiguration(dfltRegCfg);

    cfg.setDataStorageConfiguration(dsCfg);

    // Do not start cache on non-affinity node.
    CacheConfiguration ccfg = defaultCacheConfiguration().setNearConfiguration(null).
            setNodeFilter(new AttributeNodeFilter(START_CACHE_ATTR, Boolean.TRUE)).
            setBackups(0).
            setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT));

    if (mvccEnabled)
        ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);

    if (startClientCache)
        cfg.setCacheConfiguration(ccfg);

    if (getTestIgniteInstanceIndex(igniteInstanceName) != nonAffIdx) {
        cfg.setUserAttributes(F.asMap(START_CACHE_ATTR, Boolean.TRUE));

        if (!startClientCache)
            cfg.setCacheConfiguration(ccfg);
    }

    return cfg;
}