当前位置: 首页>>代码示例>>Java>>正文


Java CacheConfiguration.getBackups方法代码示例

本文整理汇总了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.
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:VisorCacheAffinityConfiguration.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:CacheSerializableTransactionsTest.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:CacheOptimisticTransactionsWithFilterTest.java


注:本文中的org.apache.ignite.configuration.CacheConfiguration.getBackups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。