/** * Non-collocated mode only makes sense for and is only supported for PARTITIONED caches, so * collocated mode should be enabled for non-partitioned cache by default. * * @param cfg Collection configuration. * @return {@code True} If collocated mode should be enabled. */ private boolean isCollocated(CollectionConfiguration cfg) { return cfg != null && (cfg.isCollocated() || cfg.getCacheMode() != PARTITIONED); }
/** {@inheritDoc} */ @Override protected CollectionConfiguration collectionConfiguration() { CollectionConfiguration colCfg = super.collectionConfiguration(); if (colCfg.getCacheMode() == PARTITIONED) colCfg.setBackups(1); return colCfg; }
boolean separated ) 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; }
/** * @return Collection configuration. */ protected CollectionConfiguration collectionConfiguration() { CollectionConfiguration colCfg = new CollectionConfiguration(); colCfg.setCacheMode(collectionCacheMode()); colCfg.setAtomicityMode(collectionCacheAtomicityMode()); colCfg.setOffHeapMaxMemory(collectionOffHeapMaxMemory()); if (colCfg.getCacheMode() == PARTITIONED) colCfg.setBackups(1); return colCfg; }
/** * Non-collocated mode only makes sense for and is only supported for PARTITIONED caches, so * collocated mode should be enabled for non-partitioned cache by default. * * @param cfg Collection configuration. * @return {@code True} If collocated mode should be enabled. */ private boolean isCollocated(CollectionConfiguration cfg) { return cfg != null && (cfg.isCollocated() || cfg.getCacheMode() != PARTITIONED); }
boolean separated ) 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; }