) throws IgniteCheckedException { String cacheName = DS_CACHE_NAME_PREFIX + cfg.getAtomicityMode() + "_" + cfg.getCacheMode() + "_" + cfg.getBackups() + "@" + grpName;
/** * @param cfg Collection configuration. * @param name Cache name. * @param grpName Group name. * @return Cache configuration. */ private CacheConfiguration cacheConfiguration(CollectionConfiguration cfg, String name, String grpName) { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(name); ccfg.setGroupName(grpName); ccfg.setBackups(cfg.getBackups()); ccfg.setCacheMode(cfg.getCacheMode()); ccfg.setAtomicityMode(cfg.getAtomicityMode()); ccfg.setNodeFilter(cfg.getNodeFilter()); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setRebalanceMode(SYNC); return ccfg; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setCacheMode(collectionCacheMode()); atomicCfg.setBackups(collectionConfiguration().getBackups()); cfg.setAtomicConfiguration(atomicCfg); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(TRANSACTIONAL_CACHE_NAME); ccfg.setAtomicityMode(TRANSACTIONAL); cfg.setCacheConfiguration(ccfg); if (client) { cfg.setClientMode(client); ((TcpDiscoverySpi)(cfg.getDiscoverySpi())).setForceServerMode(true); } return cfg; }
) throws IgniteCheckedException { String cacheName = DS_CACHE_NAME_PREFIX + cfg.getAtomicityMode() + "_" + cfg.getCacheMode() + "_" + cfg.getBackups() + "@" + grpName;
/** * @param cfg Collection configuration. * @param name Cache name. * @param grpName Group name. * @return Cache configuration. */ private CacheConfiguration cacheConfiguration(CollectionConfiguration cfg, String name, String grpName) { CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(name); ccfg.setGroupName(grpName); ccfg.setBackups(cfg.getBackups()); ccfg.setCacheMode(cfg.getCacheMode()); ccfg.setAtomicityMode(cfg.getAtomicityMode()); ccfg.setNodeFilter(cfg.getNodeFilter()); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setRebalanceMode(SYNC); return ccfg; }