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


Java CacheSimpleConfig类代码示例

本文整理汇总了Java中com.hazelcast.config.CacheSimpleConfig的典型用法代码示例。如果您正苦于以下问题:Java CacheSimpleConfig类的具体用法?Java CacheSimpleConfig怎么用?Java CacheSimpleConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setup

import com.hazelcast.config.CacheSimpleConfig; //导入依赖的package包/类
@Before
public void setup() {
    JetConfig jetConfig = new JetConfig();
    Config hazelcastConfig = jetConfig.getHazelcastConfig();
    hazelcastConfig.addCacheConfig(new CacheSimpleConfig().setName("*"));
    hazelcastConfig.addEventJournalConfig(new EventJournalConfig().setCacheName("stream*").setMapName("stream*"));
    jetInstance = createJetMember(jetConfig);
    JetInstance jetInstance2 = createJetMember(jetConfig);

    sourceName = randomString();
    sinkName = randomString();

    streamSourceName = "stream" + sourceName;
    streamSinkName = "stream" + sinkName;

    // workaround for `cache is not created` exception, create cache locally on all nodes
    JetCacheManager cacheManager = jetInstance2.getCacheManager();
    cacheManager.getCache(sourceName);
    cacheManager.getCache(sinkName);
    cacheManager.getCache(streamSourceName);
    cacheManager.getCache(streamSinkName);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:23,代码来源:HazelcastConnectorTest.java

示例2: setupCluster

import com.hazelcast.config.CacheSimpleConfig; //导入依赖的package包/类
@BeforeClass
public static void setupCluster() throws Exception {
    int parallelism = Runtime.getRuntime().availableProcessors() / MEMBER_COUNT / 2;
    JetConfig config = new JetConfig();
    config.getInstanceConfig().setCooperativeThreadCount(parallelism <= 2 ? 2 : parallelism);
    Config hzConfig = config.getHazelcastConfig();
    hzConfig.addCacheConfig(new CacheSimpleConfig().setName("*"));
    hzConfig.getMapEventJournalConfig(JOURNALED_MAP_PREFIX + '*').setEnabled(true);
    member = createCluster(MEMBER_COUNT, config);
    client = factory.newClient();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:12,代码来源:TestInClusterSupport.java

示例3: before

import com.hazelcast.config.CacheSimpleConfig; //导入依赖的package包/类
@Before
public void before() {
    JetConfig jetConfig = new JetConfig();
    Config hazelcastConfig = jetConfig.getHazelcastConfig();
    hazelcastConfig.addCacheConfig(new CacheSimpleConfig().setName("*"));
    factory = new JetTestInstanceFactory();
    jet = factory.newMember(jetConfig);
    JetInstance jet2 = factory.newMember(jetConfig);

    Config config = new Config();
    config.addCacheConfig(new CacheSimpleConfig().setName("*"));
    config.addEventJournalConfig(new EventJournalConfig().setCacheName("default").setMapName("default"));
    hz = Hazelcast.newHazelcastInstance(config);
    HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config);

    clientConfig = new ClientConfig();
    clientConfig.getGroupConfig().setName("dev");
    clientConfig.getGroupConfig().setPassword("dev-pass");
    Address address = hz.getCluster().getLocalMember().getAddress();
    clientConfig.getNetworkConfig().addAddress(address.getHost() + ':' + address.getPort());

    // workaround for `cache is not created` exception, create cache locally on all nodes
    jet2.getCacheManager().getCache(SOURCE_NAME);
    jet2.getCacheManager().getCache(SINK_NAME);
    hz2.getCacheManager().getCache(SOURCE_NAME);
    hz2.getCacheManager().getCache(SINK_NAME);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:28,代码来源:HazelcastRemoteConnectorTest.java


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