本文整理汇总了Java中org.apache.ignite.configuration.CacheConfiguration.setGroupName方法的典型用法代码示例。如果您正苦于以下问题:Java CacheConfiguration.setGroupName方法的具体用法?Java CacheConfiguration.setGroupName怎么用?Java CacheConfiguration.setGroupName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.CacheConfiguration
的用法示例。
在下文中一共展示了CacheConfiguration.setGroupName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param cfg Atomic configuration.
* @param name Cache name.
* @param grpName Group name.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(AtomicConfiguration cfg, String name, String grpName) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(name);
ccfg.setGroupName(grpName);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setRebalanceMode(SYNC);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setCacheMode(cfg.getCacheMode());
ccfg.setNodeFilter(CacheConfiguration.ALL_NODES);
ccfg.setAffinity(cfg.getAffinity());
if (cfg.getCacheMode() == PARTITIONED)
ccfg.setBackups(cfg.getBackups());
return ccfg;
}
示例2: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param grpName Cache group name.
* @param name Cache name.
* @param cacheMode Cache mode.
* @param atomicityMode Atomicity mode.
* @param backups Backups number.
* @param heapCache On heap cache flag.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(
String grpName,
String name,
CacheMode cacheMode,
CacheAtomicityMode atomicityMode,
int backups,
boolean heapCache
) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(name);
ccfg.setGroupName(grpName);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setBackups(backups);
ccfg.setCacheMode(cacheMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setOnheapCacheEnabled(heapCache);
return ccfg;
}
示例3: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param name Name.
* @param atomicityMode Atomicity mode.
* @param cacheMode Cache mode.
* @param backups Backups.
* @param grp Group.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(String name,
CacheAtomicityMode atomicityMode,
CacheMode cacheMode,
int backups,
String grp) {
CacheConfiguration ccfg = new CacheConfiguration(name);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setCacheMode(cacheMode);
ccfg.setGroupName(grp);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 128));
if (cacheMode == PARTITIONED)
ccfg.setBackups(backups);
return ccfg;
}
示例4: getConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi)cfg.getDiscoverySpi();
discoverySpi.setIpFinder(ipFinder);
CacheConfiguration ccfg2 = new CacheConfiguration();
ccfg2.setName(CACHE_NAME);
ccfg2.setGroupName(CACHE_GROUP_NAME);
ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg2.setIndexedTypes(Integer.class, Integer.class);
ccfg2.setBackups(2);
cfg.setCacheConfiguration(ccfg2);
return cfg;
}
示例5: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param grpName Cache group name.
* @param name Cache name.
* @param cacheMode Cache mode.
* @param atomicityMode Atomicity mode.
* @param backups Backups number.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(
String grpName,
String name,
CacheMode cacheMode,
CacheAtomicityMode atomicityMode,
int backups
) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(name);
ccfg.setGroupName(grpName);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setBackups(backups);
ccfg.setCacheMode(cacheMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
return ccfg;
}
示例6: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param grpName Cache group name.
* @param name Cache name.
* @param cacheMode Cache mode.
* @param atomicityMode Atomicity mode.
* @param backups Backups number.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(
String grpName,
String name,
CacheMode cacheMode,
CacheAtomicityMode atomicityMode,
int backups,
String dataRegName
) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(name);
ccfg.setGroupName(grpName);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setBackups(backups);
ccfg.setCacheMode(cacheMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setDataRegionName(dataRegName);
return ccfg;
}
示例7: cacheConfigurations
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param grp Group name.
* @param atomicityMode Atomicity mode.
* @return Cache configurations.
*/
private List<CacheConfiguration> cacheConfigurations(@Nullable String grp, CacheAtomicityMode atomicityMode) {
List<CacheConfiguration> ccfgs = new ArrayList<>();
for (int i = 0; i < 3; i++) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setGroupName(grp);
ccfg.setName("cache-" + atomicityMode + "-" + i);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfgs.add(ccfg);
}
return ccfgs;
}
示例8: getConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
CacheConfiguration cfg1 = defaultCacheConfiguration()
.setName(CACHE1)
.setGroupName(GROUP1)
.setCacheMode(cacheMode)
.setAtomicityMode(atomicityMode)
.setBackups(1);
CacheConfiguration cfg2 = new CacheConfiguration(cfg1)
.setName(CACHE2);
if (!sameGrp)
cfg2.setGroupName(GROUP2);
cfg.setCacheConfiguration(cfg1, cfg2);
return cfg;
}
示例9: configure
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void configure(IgniteConfiguration cfg) {
super.configure(cfg);
for (CacheConfiguration ccfg : cfg.getCacheConfiguration()) {
AffinityFunction aff = ccfg.getAffinity();
int parts = aff != null ? aff.partitions() : RendezvousAffinityFunction.DFLT_PARTITION_COUNT;
ccfg.setGroupName("testGroup-parts" + parts);
}
}
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:IgnitePdsSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest.java
示例10: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param grpName Group name.
* @param cacheName Cache name.
* @param queryEntity Query entity.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(String grpName, String cacheName, QueryEntity queryEntity) {
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setGroupName(grpName);
ccfg.setName(cacheName);
ccfg.setQueryEntities(F.asList(queryEntity));
return ccfg;
}
示例11: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
ccfg.setGroupName("group1");
return ccfg;
}
示例12: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param cacheName Cache name.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(String cacheName) {
CacheConfiguration ccfg = new CacheConfiguration(cacheName);
ccfg.setName(cacheName);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 16));
if (withCacheGrp)
ccfg.setGroupName("group1");
return ccfg;
}
示例13: getConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(spi);
// Default cache config.
CacheConfiguration dfltCacheCfg = defaultCacheConfiguration();
dfltCacheCfg.setCacheMode(PARTITIONED);
dfltCacheCfg.setRebalanceMode(ASYNC);
dfltCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
dfltCacheCfg.setAffinity(new RendezvousAffinityFunction());
dfltCacheCfg.setIndexedTypes(
Integer.class, String.class
);
// Non-default cache configuration.
CacheConfiguration namedCacheCfg = defaultCacheConfiguration();
namedCacheCfg.setCacheMode(PARTITIONED);
namedCacheCfg.setRebalanceMode(ASYNC);
namedCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
namedCacheCfg.setAffinity(new RendezvousAffinityFunction());
// Modify cache config according to test parameters.
if (igniteInstanceName.contains(WRONG_PRELOAD_MODE_IGNITE_INSTANCE_NAME))
dfltCacheCfg.setRebalanceMode(SYNC);
else if (igniteInstanceName.contains(WRONG_CACHE_MODE_IGNITE_INSTANCE_NAME))
dfltCacheCfg.setCacheMode(REPLICATED);
else if (igniteInstanceName.contains(WRONG_AFFINITY_IGNITE_INSTANCE_NAME))
dfltCacheCfg.setAffinity(new TestRendezvousAffinityFunction());
else if (igniteInstanceName.contains(WRONG_AFFINITY_MAPPER_IGNITE_INSTANCE_NAME))
dfltCacheCfg.setAffinityMapper(new TestCacheDefaultAffinityKeyMapper());
if (igniteInstanceName.contains(DUP_CACHES_IGNITE_INSTANCE_NAME))
cfg.setCacheConfiguration(namedCacheCfg, namedCacheCfg);
else if (igniteInstanceName.contains(DUP_DFLT_CACHES_IGNITE_INSTANCE_NAME))
cfg.setCacheConfiguration(dfltCacheCfg, dfltCacheCfg);
else
// Normal configuration.
cfg.setCacheConfiguration(dfltCacheCfg, namedCacheCfg);
if (igniteInstanceName.contains(RESERVED_FOR_DATASTRUCTURES_CACHE_NAME_IGNITE_INSTANCE_NAME))
namedCacheCfg.setName(DataStructuresProcessor.ATOMICS_CACHE_NAME + "@abc");
else
namedCacheCfg.setName(NON_DFLT_CACHE_NAME);
if (igniteInstanceName.contains(RESERVED_FOR_DATASTRUCTURES_CACHE_GROUP_NAME_IGNITE_INSTANCE_NAME))
namedCacheCfg.setGroupName("default-ds-group");
return cfg;
}
示例14: cacheConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* Creates new cache configuration.
*
* @param name Cache name.
* @param mode Cache mode.
* @param clsK Key class.
* @param clsV Value class.
* @return Cache configuration.
*/
@Override protected CacheConfiguration cacheConfiguration(String name, CacheMode mode, Class<?> clsK, Class<?> clsV) {
CacheConfiguration<?,?> cc = super.cacheConfiguration(name, mode, clsK, clsV);
if (ORG.equals(name) || PERS.equals(name) || PURCH.equals(name))
cc.setGroupName("group");
return cc;
}