Search in sources :

Example 1 with JetCacheManager

use of com.hazelcast.jet.JetCacheManager in project hazelcast-jet by hazelcast.

the class HazelcastConnectorTest method setup.

@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);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) JetInstance(com.hazelcast.jet.JetInstance) JetCacheManager(com.hazelcast.jet.JetCacheManager) JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Aggregations

CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)1 Config (com.hazelcast.config.Config)1 EventJournalConfig (com.hazelcast.config.EventJournalConfig)1 JetCacheManager (com.hazelcast.jet.JetCacheManager)1 JetInstance (com.hazelcast.jet.JetInstance)1 JetConfig (com.hazelcast.jet.config.JetConfig)1 Before (org.junit.Before)1