@Override public EventJournalConfig getStaticConfig(@Nonnull Config staticConfig, @Nonnull String name) { return staticConfig.getMapEventJournalConfig(name); }
@Override public EventJournalConfig getStaticConfig(@Nonnull Config staticConfig, @Nonnull String name) { return staticConfig.getMapEventJournalConfig(name); }
public static void main(String[] args) throws Exception { System.setProperty("hazelcast.logging.type", "log4j"); // Lower operation timeout to speed up job cancellation System.setProperty("hazelcast.operation.call.timeout.millis", "1000"); JetConfig cfg = new JetConfig(); cfg.getHazelcastConfig().getMapEventJournalConfig(TRADES).setEnabled(true); JetInstance jet = Jet.newJetInstance(cfg); Jet.newJetInstance(cfg); new Enrichment(jet).go(); }
private static JetConfig getJetConfig() { JetConfig cfg = new JetConfig(); // Add an event journal config for map which has custom capacity of 1000 (default 10_000) // and time to live seconds as 10 seconds (default 0 which means infinite) cfg.getHazelcastConfig() .getMapEventJournalConfig(MAP_NAME) .setEnabled(true) .setCapacity(1000) .setTimeToLiveSeconds(10); return cfg; }
/** * Returns a read-only map {@link EventJournal} * configuration for the given name. * <p> * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given {@code name}. * If there is no config found by the name, it will return the configuration * with the name {@code default}. * * @param name name of the map event journal config * @return the map event journal configuration * @throws ConfigurationException if ambiguous configurations are found * @see StringPartitioningStrategy#getBaseName(java.lang.String) * @see #setConfigPatternMatcher(ConfigPatternMatcher) * @see #getConfigPatternMatcher() * @see EvictionConfig#setSize(int) */ public EventJournalConfig findMapEventJournalConfig(String name) { name = getBaseName(name); final EventJournalConfig config = lookupByPattern(configPatternMatcher, mapEventJournalConfigs, name); if (config != null) { return config.getAsReadOnly(); } return getMapEventJournalConfig("default").getAsReadOnly(); }
/** * Returns a read-only map {@link EventJournal} * configuration for the given name. * <p> * The name is matched by pattern to the configuration and by stripping the * partition ID qualifier from the given {@code name}. * If there is no config found by the name, it will return the configuration * with the name {@code default}. * * @param name name of the map event journal config * @return the map event journal configuration * @throws ConfigurationException if ambiguous configurations are found * @see StringPartitioningStrategy#getBaseName(java.lang.String) * @see #setConfigPatternMatcher(ConfigPatternMatcher) * @see #getConfigPatternMatcher() * @see EvictionConfig#setSize(int) */ public EventJournalConfig findMapEventJournalConfig(String name) { name = getBaseName(name); final EventJournalConfig config = lookupByPattern(configPatternMatcher, mapEventJournalConfigs, name); if (config != null) { return config.getAsReadOnly(); } return getMapEventJournalConfig("default").getAsReadOnly(); }
public static void main(String[] args) throws Exception { System.setProperty("hazelcast.logging.type", "log4j"); // All IMap partitions must receive updates for the watermark to advance // correctly. Since we use just a handful of keys in this sample, we set a // low partition count. System.setProperty("hazelcast.partition.count", "1"); JetConfig cfg = new JetConfig(); cfg.getHazelcastConfig().getMapEventJournalConfig("*").setEnabled(true); JetInstance jet = Jet.newJetInstance(cfg); ProducerTask producer = new ProducerTask(jet); try { // uncomment one of these // Pipeline p = aggregate(); // Pipeline p = groupAndAggregate(); Pipeline p = coGroup(); // Pipeline p = coGroupWithBuilder(); System.out.println("Running pipeline " + p); Job job = jet.newJob(p); Thread.sleep(5000); producer.stop(); job.cancel(); } finally { producer.stop(); Jet.shutdownAll(); } }
config.getHazelcastConfig().getMapEventJournalConfig("source").setEnabled(true); JetInstance instance1 = Jet.newJetInstance(config); JetInstance instance2 = Jet.newJetInstance(config);
config.getHazelcastConfig().getMapEventJournalConfig("source").setEnabled(true); JetInstance instance1 = Jet.newJetInstance(config); JetInstance instance2 = Jet.newJetInstance(config);
config.getHazelcastConfig().getMapEventJournalConfig("source").setEnabled(true); JetInstance instance1 = Jet.newJetInstance(config); JetInstance instance2 = Jet.newJetInstance(config);