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


Java CacheConfiguration.setStatisticsEnabled方法代码示例

本文整理汇总了Java中org.apache.ignite.configuration.CacheConfiguration.setStatisticsEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java CacheConfiguration.setStatisticsEnabled方法的具体用法?Java CacheConfiguration.setStatisticsEnabled怎么用?Java CacheConfiguration.setStatisticsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.configuration.CacheConfiguration的用法示例。


在下文中一共展示了CacheConfiguration.setStatisticsEnabled方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param atomicityMode Atomicity mode.
 * @param offheapMem Offheap memory size.
 * @param idx Indexing enabled flag.
 * @return Cache configuration.
 */
private CacheConfiguration<String, TestIndexedType> cacheConfiguration(CacheAtomicityMode atomicityMode,
    long offheapMem,
    boolean idx) {
    CacheConfiguration<String, TestIndexedType> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    ccfg.setAtomicityMode(atomicityMode);
    ccfg.setBackups(1);
    ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
    ccfg.setStatisticsEnabled(true);

    if (idx)
        ccfg.setIndexedTypes(String.class, TestIndexedType.class);

    return ccfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:22,代码来源:CacheOperationsWithExpirationTest.java

示例2: 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(IP_FINDER);

    cfg.setDiscoverySpi(spi);

    cfg.setCacheConfiguration();
    cfg.setMetricsUpdateFrequency(500);

    CacheConfiguration<Integer, Object> ccfg = defaultCacheConfiguration();
    ccfg.setName(CACHE_NAME);
    ccfg.setStatisticsEnabled(true);

    FifoEvictionPolicy plc = new FifoEvictionPolicy();
    plc.setMaxMemorySize(MAX_VALS_AMOUNT * VAL_SIZE);
    plc.setMaxSize(0);

    ccfg.setEvictionPolicy(plc);
    ccfg.setOnheapCacheEnabled(true);

    return cfg.setCacheConfiguration(ccfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:27,代码来源:ClusterNodeMetricsSelfTest.java

示例3: geneCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * 
 * @return CacheConfiguration<Long, Gene>
 */
public static CacheConfiguration<Long, Gene> geneCache() {

    CacheConfiguration<Long, Gene> cfg = new CacheConfiguration<>(GAGridConstants.GENE_CACHE);
    cfg.setIndexedTypes(Long.class, Gene.class);
    cfg.setCacheMode(CacheMode.REPLICATED);
    cfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cfg.setStatisticsEnabled(true);
    cfg.setBackups(1);
    cfg.setSqlFunctionClasses(GAGridFunction.class);
    return cfg;

}
 
开发者ID:techbysample,项目名称:gagrid,代码行数:17,代码来源:GeneCacheConfig.java

示例4: populationCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * 
 * @return CacheConfiguration<Long, Chromosome>
 */
public static CacheConfiguration<Long, Chromosome> populationCache() {

    CacheConfiguration<Long, Chromosome> cfg = new CacheConfiguration<>(GAGridConstants.POPULATION_CACHE);
    cfg.setIndexedTypes(Long.class, Chromosome.class);
    cfg.setCacheMode(CacheMode.PARTITIONED);
    cfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cfg.setStatisticsEnabled(true);
    cfg.setBackups(1);

    return cfg;

}
 
开发者ID:techbysample,项目名称:gagrid,代码行数:18,代码来源:PopulationCacheConfig.java

示例5: getConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    CacheConfiguration<Integer, String> cacheCfg1 = defaultCacheConfiguration();

    cacheCfg1.setName("A");
    cacheCfg1.setCacheMode(cacheMode);
    cacheCfg1.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg1.setIndexedTypes(Integer.class, String.class);
    cacheCfg1.setStatisticsEnabled(true);

    CacheConfiguration<Integer, String> cacheCfg2 = defaultCacheConfiguration();

    cacheCfg2.setName("B");
    cacheCfg2.setCacheMode(cacheMode);
    cacheCfg2.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg2.setIndexedTypes(Integer.class, String.class);
    cacheCfg2.setStatisticsEnabled(true);

    cfg.setCacheConfiguration(cacheCfg1, cacheCfg2);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:31,代码来源:CacheAbstractQueryMetricsSelfTest.java

示例6: configureCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param cacheName Cache name.
 * @return Cache configuration.
 */
private CacheConfiguration<Integer, String> configureCache(String cacheName) {
    CacheConfiguration<Integer, String> ccfg = defaultCacheConfiguration();

    ccfg.setName(cacheName);
    ccfg.setCacheMode(cacheMode);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);
    ccfg.setIndexedTypes(Integer.class, String.class);
    ccfg.setStatisticsEnabled(true);
    ccfg.setQueryDetailMetricsSize(QRY_DETAIL_METRICS_SIZE);

    return ccfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:CacheAbstractQueryDetailMetricsSelfTest.java

示例7: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param cacheName Cache name.
 * @return Cache configuration.
 * @throws Exception In case of error.
 */
private CacheConfiguration cacheConfiguration(@NotNull String cacheName) throws Exception {
    CacheConfiguration cfg = defaultCacheConfiguration();

    cfg.setCacheMode(LOCAL);
    cfg.setName(cacheName);
    cfg.setWriteSynchronizationMode(FULL_SYNC);
    cfg.setStatisticsEnabled(true);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:RestMemcacheProtocolSelfTest.java

示例8: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create base cache configuration.
 *
 * @param name cache name.
 * @return Cache configuration with basic properties set.
 */
private static CacheConfiguration cacheConfiguration(String name) {
    CacheConfiguration ccfg = new CacheConfiguration<>(name);

    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setQueryDetailMetricsSize(10);
    ccfg.setStatisticsEnabled(true);
    ccfg.setSqlFunctionClasses(SQLFunctions.class);
    ccfg.setDataRegionName("demo");

    return ccfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:DemoCachesLoadService.java

示例9: cacheRandom

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Configure cacheCountry.
 */
private static <K, V> CacheConfiguration<K, V> cacheRandom() {
    CacheConfiguration<K, V> ccfg = new CacheConfiguration<>(RANDOM_CACHE_NAME);

    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setQueryDetailMetricsSize(10);
    ccfg.setStatisticsEnabled(true);
    ccfg.setIndexedTypes(Integer.class, Integer.class);

    return ccfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:14,代码来源:DemoRandomCacheLoadService.java

示例10: getConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(discoSpi);

    LruEvictionPolicy evictionPolicy = new LruEvictionPolicy<>();
    evictionPolicy.setMaxSize(LRU_MAX_SIZE);

    CacheConfiguration<String, byte[]> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setBackups(1);
    cacheCfg.setReadFromBackup(true);
    cacheCfg.setEvictionPolicy(evictionPolicy);
    cacheCfg.setOnheapCacheEnabled(true);
    cacheCfg.setStatisticsEnabled(true);

    cacheCfg.setWriteThrough(false);
    cacheCfg.setReadThrough(false);

    cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new Storage()));

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:IgniteCacheLoadRebalanceEvictionSelfTest.java

示例11: createCaches

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param statisticsEnabled Statistics enabled.
 */
private void createCaches(boolean statisticsEnabled) {
    CacheConfiguration ccfg1 = defaultCacheConfiguration();
    ccfg1.setName(CACHE1);
    ccfg1.setStatisticsEnabled(statisticsEnabled);

    CacheConfiguration ccfg2 = defaultCacheConfiguration();
    ccfg2.setName(CACHE2);
    ccfg2.setStatisticsEnabled(statisticsEnabled);

    cache1 = grid(0).getOrCreateCache(ccfg1);
    cache2 = grid(0).getOrCreateCache(ccfg2);
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:CacheMetricsForClusterGroupSelfTest.java

示例12: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
private static CacheConfiguration<Integer, Integer> cacheConfiguration(String cacheName) {
    CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>(cacheName);

    cfg.setBackups(1);
    cfg.setStatisticsEnabled(true);
    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:OffheapCacheMetricsForClusterGroupSelfTest.java

示例13: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Cache configuration.
 *
 * @return Cache configuration.
 * @throws Exception In case of error.
 */
protected CacheConfiguration cacheConfiguration() throws Exception {
    CacheConfiguration cfg = defaultCacheConfiguration();

    cfg.setCacheMode(PARTITIONED);
    cfg.setWriteSynchronizationMode(FULL_ASYNC);
    cfg.setEvictionPolicy(null);
    cfg.setBackups(1);
    cfg.setNearConfiguration(null);
    cfg.setStatisticsEnabled(true);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:19,代码来源:GridCachePartitionedHitsAndMissesSelfTest.java

示例14: testPublicApiStatisticsEnable

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 *
 */
public void testPublicApiStatisticsEnable() throws Exception {
    Ignite ig1 = startGrid(1);
    startGrid(2);

    IgniteCache<?, ?> cache1 = ig1.cache(CACHE1);

    CacheConfiguration cacheCfg2 = new CacheConfiguration(cache1.getConfiguration(CacheConfiguration.class));

    cacheCfg2.setName(CACHE2);
    cacheCfg2.setStatisticsEnabled(true);

    ig1.getOrCreateCache(cacheCfg2);

    assertCachesStatisticsMode(false, true);

    cache1.enableStatistics(true);

    assertCachesStatisticsMode(true, true);

    ig1.cluster().enableStatistics(Arrays.asList(CACHE1, CACHE2), false);

    assertCachesStatisticsMode(false, false);
}
 
开发者ID:apache,项目名称:ignite,代码行数:27,代码来源:CacheMetricsEnableRuntimeTest.java


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