Search in sources :

Example 31 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast-jet by hazelcast.

the class StreamEventJournalPTest method setUp.

@Before
public void setUp() {
    JetConfig config = new JetConfig();
    EventJournalConfig journalConfig = new EventJournalConfig().setMapName("*").setCapacity(JOURNAL_CAPACITY).setEnabled(true);
    config.getHazelcastConfig().setProperty(PARTITION_COUNT.getName(), String.valueOf(NUM_PARTITIONS));
    config.getHazelcastConfig().addEventJournalConfig(journalConfig);
    instance = this.createJetMember(config);
    map = (MapProxyImpl<String, Integer>) instance.getHazelcastInstance().<String, Integer>getMap("test");
    List<Integer> allPartitions = IntStream.range(0, NUM_PARTITIONS).boxed().collect(toList());
    supplier = () -> new StreamEventJournalP<>(map, allPartitions, e -> true, EventJournalMapEvent::getNewValue, START_FROM_OLDEST, false, wmGenParams(Integer::intValue, limitingLag(0), suppressAll(), -1));
    key0 = generateKeyForPartition(instance.getHazelcastInstance(), 0);
    key1 = generateKeyForPartition(instance.getHazelcastInstance(), 1);
}
Also used : IntStream(java.util.stream.IntStream) PARTITION_COUNT(com.hazelcast.spi.properties.GroupProperty.PARTITION_COUNT) Arrays(java.util.Arrays) WatermarkPolicies.limitingLag(com.hazelcast.jet.core.WatermarkPolicies.limitingLag) JetInstance(com.hazelcast.jet.JetInstance) RunWith(org.junit.runner.RunWith) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Processor(com.hazelcast.jet.core.Processor) TestOutbox(com.hazelcast.jet.core.test.TestOutbox) TestProcessorContext(com.hazelcast.jet.core.test.TestProcessorContext) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) MapProxyImpl(com.hazelcast.map.impl.proxy.MapProxyImpl) WatermarkGenerationParams.wmGenParams(com.hazelcast.jet.core.WatermarkGenerationParams.wmGenParams) EventJournalMapEvent(com.hazelcast.map.journal.EventJournalMapEvent) Before(org.junit.Before) TestInbox(com.hazelcast.jet.core.test.TestInbox) DistributedSupplier(com.hazelcast.jet.function.DistributedSupplier) JetConfig(com.hazelcast.jet.config.JetConfig) JetTestSupport(com.hazelcast.jet.core.JetTestSupport) WatermarkEmissionPolicy(com.hazelcast.jet.core.WatermarkEmissionPolicy) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) START_FROM_OLDEST(com.hazelcast.jet.pipeline.JournalInitialPosition.START_FROM_OLDEST) Collectors(java.util.stream.Collectors) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) SAME_ITEMS_ANY_ORDER(com.hazelcast.jet.core.test.TestSupport.SAME_ITEMS_ANY_ORDER) TestSupport(com.hazelcast.jet.core.test.TestSupport) Assert.assertFalse(org.junit.Assert.assertFalse) HazelcastParallelClassRunner(com.hazelcast.test.HazelcastParallelClassRunner) Entry(java.util.Map.Entry) Assert.assertEquals(org.junit.Assert.assertEquals) JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Example 32 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast-jet by hazelcast.

the class StreamEventJournalP_WmCoalescingTest method setUp.

@Before
public void setUp() {
    JetConfig config = new JetConfig();
    EventJournalConfig journalConfig = new EventJournalConfig().setMapName("*").setCapacity(JOURNAL_CAPACITY).setEnabled(true);
    config.getHazelcastConfig().setProperty(PARTITION_COUNT.getName(), "2");
    config.getHazelcastConfig().addEventJournalConfig(journalConfig);
    JetInstance instance = this.createJetMember(config);
    assert map == null;
    map = (MapProxyImpl<Integer, Integer>) instance.getHazelcastInstance().<Integer, Integer>getMap("test");
    partitionKeys = new int[2];
    for (int i = 1; IntStream.of(partitionKeys).anyMatch(val -> val == 0); i++) {
        int partitionId = instance.getHazelcastInstance().getPartitionService().getPartition(i).getPartitionId();
        partitionKeys[partitionId] = i;
    }
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Aggregations

EventJournalConfig (com.hazelcast.config.EventJournalConfig)32 Config (com.hazelcast.config.Config)13 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)10 JetConfig (com.hazelcast.jet.config.JetConfig)9 Before (org.junit.Before)9 MapConfig (com.hazelcast.config.MapConfig)6 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)6 AttributeConfig (com.hazelcast.config.AttributeConfig)5 IndexConfig (com.hazelcast.config.IndexConfig)5 MapStoreConfig (com.hazelcast.config.MapStoreConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 NearCacheConfig (com.hazelcast.config.NearCacheConfig)5 AwsConfig (com.hazelcast.config.AwsConfig)4 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)4 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)4 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)4 DiskTierConfig (com.hazelcast.config.DiskTierConfig)4 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)4 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)4 EvictionConfig (com.hazelcast.config.EvictionConfig)4