本文整理汇总了Java中org.apache.ignite.configuration.CacheConfiguration.getBackups方法的典型用法代码示例。如果您正苦于以下问题:Java CacheConfiguration.getBackups方法的具体用法?Java CacheConfiguration.getBackups怎么用?Java CacheConfiguration.getBackups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.CacheConfiguration
的用法示例。
在下文中一共展示了CacheConfiguration.getBackups方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VisorCacheAffinityConfiguration
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* Create data transfer object for affinity configuration properties.
*
* @param ccfg Cache configuration.
*/
public VisorCacheAffinityConfiguration(CacheConfiguration ccfg) {
AffinityFunction aff = ccfg.getAffinity();
function = compactClass(aff);
mapper = compactClass(ccfg.getAffinityMapper());
partitions = aff.partitions();
partitionedBackups = ccfg.getBackups();
Method mthd = findNonPublicMethod(aff.getClass(), "isExcludeNeighbors");
if (mthd != null) {
try {
exclNeighbors = (Boolean)mthd.invoke(aff);
}
catch (InvocationTargetException | IllegalAccessException ignored) {
// No-op.
}
}
}
示例2: testKeys
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param cache Cache.
* @return Test keys.
* @throws Exception If failed.
*/
private List<Integer> testKeys(IgniteCache<Integer, Integer> cache) throws Exception {
CacheConfiguration ccfg = cache.getConfiguration(CacheConfiguration.class);
List<Integer> keys = new ArrayList<>();
if (!cache.unwrap(Ignite.class).configuration().isClientMode()) {
if (ccfg.getCacheMode() == PARTITIONED)
keys.add(nearKey(cache));
keys.add(primaryKey(cache));
if (ccfg.getBackups() != 0)
keys.add(backupKey(cache));
}
else
keys.add(nearKey(cache));
return keys;
}
示例3: testKeys
import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
* @param cache Cache.
* @return Test keys.
* @throws Exception If failed.
*/
private List<Integer> testKeys(IgniteCache<Integer, Integer> cache) throws Exception {
CacheConfiguration ccfg = cache.getConfiguration(CacheConfiguration.class);
List<Integer> keys = new ArrayList<>();
if (!cache.unwrap(Ignite.class).configuration().isClientMode()) {
if (ccfg.getCacheMode() == PARTITIONED && serversNumber() > 1)
keys.add(nearKey(cache));
keys.add(primaryKey(cache));
if (ccfg.getBackups() != 0 && serversNumber() > 1)
keys.add(backupKey(cache));
}
else
keys.add(nearKey(cache));
return keys;
}