com.hazelcast.config.Config.addEventJournalConfig()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中com.hazelcast.config.Config.addEventJournalConfig()方法的一些代码示例,展示了Config.addEventJournalConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.addEventJournalConfig()方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:addEventJournalConfig

Config.addEventJournalConfig介绍

[英]Adds the event journal configuration. The configuration may apply to a map and/or cache. A non-empty value for EventJournalConfig#getMapName()means the configuration applies to maps and a non-empty value for EventJournalConfig#getCacheName() means the configuration applies to caches. The returned name may be a pattern with which the configuration will be obtained in the future.
[中]添加事件日志配置。该配置可应用于映射和/或缓存。EventJournalConfig#getMapName()的非空值表示配置应用于映射,EventJournalConfig#getCacheName()的非空值表示配置应用于缓存。返回的名称可能是将来获取配置的模式。

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

private void handleEventJournal(Node node) throws Exception {
  EventJournalConfig journalConfig = new EventJournalConfig();
  handleViaReflection(node, config, journalConfig);
  config.addEventJournalConfig(journalConfig);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private void handleEventJournal(Node node) throws Exception {
  EventJournalConfig journalConfig = new EventJournalConfig();
  handleViaReflection(node, config, journalConfig);
  config.addEventJournalConfig(journalConfig);
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

private static Config getConfig() {
  Config config = new Config();
  // 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)
  config.addEventJournalConfig(new EventJournalConfig().setEnabled(true)
                             .setMapName(MAP_NAME)
                             .setCapacity(1000)
                             .setTimeToLiveSeconds(10));
  return config;
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

public static void main(String[] args) {
  System.setProperty("hazelcast.logging.type", "log4j");
  JetConfig config = new JetConfig();
  config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig()
      .setMapName(TRADES_MAP_NAME)
      .setCapacity(TRADES_PER_SEC * 10));
  config.getInstanceConfig().setCooperativeThreadCount(
      Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
  JetInstance jet = Jet.newJetInstance(config);
  Jet.newJetInstance(config);
  try {
    jet.newJob(buildPipeline());
    TradeGenerator.generate(NUMBER_OF_TICKERS, jet.getMap(TRADES_MAP_NAME), TRADES_PER_SEC, JOB_DURATION);
  } finally {
    Jet.shutdownAll();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Before
public void setup() {
  JetConfig cfg = new JetConfig();
  cfg.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig().setMapName(SOURCE_NAME));
  jet = createJetMember(cfg);
  baosOut = new ByteArrayOutputStream();
  baosErr = new ByteArrayOutputStream();
  out = new PrintStream(baosOut);
  err = new PrintStream(baosErr);
  sourceMap = jet.getMap(SOURCE_NAME);
  IntStream.range(0, ITEM_COUNT).forEach(i -> sourceMap.put(i, i));
  sinkList = jet.getList(SINK_NAME);
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

public static void main(String[] args) {
  System.setProperty("hazelcast.logging.type", "log4j");
  JetConfig config = new JetConfig();
  config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig()
      .setMapName(TRADES_MAP_NAME));
  JetInstance jet = Jet.newJetInstance(config);
  Jet.newJetInstance(config);
  try {
    jet.newJob(buildDag());
    TradeGenerator.generate(100, jet.getMap(TRADES_MAP_NAME), TRADES_PER_SECOND, JOB_DURATION);
  } finally {
    Jet.shutdownAll();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

public static void main(String[] args) {
  System.setProperty("hazelcast.logging.type", "log4j");
  JetConfig config = new JetConfig();
  config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig()
      .setMapName(TRADES_MAP_NAME));
  JetInstance jet = Jet.newJetInstance(config);
  Jet.newJetInstance(config);
  try {
    jet.newJob(buildDag());
    TradeGenerator.generate(100, jet.getMap(TRADES_MAP_NAME), TRADES_PER_SECOND, JOB_DURATION);
  } finally {
    Jet.shutdownAll();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

private static Config getConfig() {
  Config config = new Config();
  config.addCacheConfig(new CacheSimpleConfig().setName(CACHE_NAME));
  // Add an event journal config for cache which has custom capacity of 1000 (default 10_000)
  // and time to live seconds as 10 seconds (default 0 which means infinite)
  config.addEventJournalConfig(new EventJournalConfig().setEnabled(true)
                             .setCacheName(CACHE_NAME)
                             .setCapacity(1000)
                             .setTimeToLiveSeconds(10));
  return config;
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

public static void main(String[] args) {
    System.setProperty("hazelcast.logging.type", "log4j");
    JetConfig config = new JetConfig();
    config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig()
        .setMapName(TRADES_MAP_NAME)
        .setCapacity(TRADES_PER_SEC * 10));

    JetInstance jet = Jet.newJetInstance(config);
    new TradingVolumeGui(jet.getMap(VOLUME_MAP_NAME));
    Jet.newJetInstance(config);
    try {
      jet.newJob(buildPipeline());
      TradeGenerator.generate(NUMBER_OF_TICKERS, jet.getMap(TRADES_MAP_NAME), TRADES_PER_SEC);
    } finally {
      Jet.shutdownAll();
    }
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

public static void main(String[] args) {
    System.setProperty("hazelcast.logging.type", "log4j");
    JetInstance jet = JetBootstrap.getInstance();

    jet.getHazelcastInstance().getConfig().addEventJournalConfig(new EventJournalConfig()
        .setMapName(TRADES_MAP_NAME)
        .setCapacity(TRADES_PER_SEC * 10));

    startConsolePrinterThread(jet, VOLUME_MAP_NAME);
    try {
      JobConfig jobConfig = new JobConfig();
      jobConfig.setName("Trade Volume");
      jet.newJob(buildPipeline(), jobConfig);
      TradeGenerator.generate(NUMBER_OF_TICKERS, jet.getMap(TRADES_MAP_NAME), TRADES_PER_SEC);
    } finally {
      stopConsolePrinterThread();
      Jet.shutdownAll();
    }
  }
}

相关文章

Config类方法