com.hazelcast.jet.Jet.newJetInstance()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(206)

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

Jet.newJetInstance介绍

[英]Creates a member of the Jet cluster with the configuration loaded from default location.
[中]使用从默认位置加载的配置创建Jet群集的成员。

代码示例

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

private static JetInstance startLocalJetCluster() {
  JetInstance localJet = Jet.newJetInstance();
  Jet.newJetInstance();
  return localJet;
}

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

private static JetInstance startLocalJetCluster() {
  JetInstance localJet = Jet.newJetInstance();
  Jet.newJetInstance();
  return localJet;
}

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

private static JetInstance startJet() {
  System.out.println("Creating Jet instance 1");
  Jet.newJetInstance();
  System.out.println("Creating Jet instance 2");
  return Jet.newJetInstance();
}

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

private void setup() {
  if (!Paths.get(AvroSink.DIRECTORY_NAME).toFile().exists()) {
    System.out.println("Avro files directory does not exist, please run " +
        AvroSink.class.getSimpleName() + " first to create it.");
    System.exit(0);
  }
  jet = Jet.newJetInstance();
  Jet.newJetInstance();
}

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

public static void main(String[] args) {
  System.setProperty("hazelcast.logging.type", "log4j");
  JetInstance jet = Jet.newJetInstance();
  Jet.newJetInstance();
  new BatchCoGroup(jet).go();
}

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

private void setup() throws Exception {
  dbDirectory = Files.createTempDirectory(JdbcSource.class.getName()).toString();
  createAndFillTable();
  jet = Jet.newJetInstance();
  Jet.newJetInstance();
}

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

/**
 * Creates a member of the Jet cluster with the configuration loaded from
 * default location.
 */
public static JetInstance newJetInstance() {
  return newJetInstance(JetConfig.loadDefault());
}

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

private void setup() {
  JetConfig cfg = new JetConfig();
  System.out.println("Creating Jet instance 1");
  jet = Jet.newJetInstance(cfg);
}

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

private void setup() {
  JetConfig cfg = new JetConfig();
  System.out.println("Creating Jet instance");
  jet = Jet.newJetInstance(cfg);
}

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

private void setup() throws Exception {
  dbDirectory = Files.createTempDirectory(JdbcSink.class.getName()).toString();
  createTable();
  jet = Jet.newJetInstance();
  Jet.newJetInstance();
  IMapJet<Integer, User> map = jet.getMap(MAP_NAME);
  // populate the source IMap
  for (int i = 0; i < 100; i++) {
    map.put(i, new User(i, "name-" + i));
  }
}

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

public static void main(String[] args) throws Exception {
  System.setProperty("hazelcast.logging.type", "log4j");
  JetInstance jet = Jet.newJetInstance();
  Jet.newJetInstance();
  try {
    jet.newJob(buildPipeline());
    Thread.sleep(JOB_DURATION_MS);
  } finally {
    Jet.shutdownAll();
  }
}

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

@Bean
public JetInstance jetInstance(Config config) {
  JetConfig jetConfig = new JetConfig().setHazelcastConfig(config);
  return Jet.newJetInstance(jetConfig);
}

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

private void setup() throws Exception {
  scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
  activeMQBroker = new ActiveMQBroker();
  activeMQBroker.start();
  producer = new JmsMessageProducer(INPUT_TOPIC, JmsMessageProducer.DestinationType.TOPIC);
  producer.start();
  jet = Jet.newJetInstance();
}

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

private void setup() {
  JetConfig cfg = new JetConfig();
  cfg.setInstanceConfig(new InstanceConfig().setCooperativeThreadCount(
      Math.max(1, getRuntime().availableProcessors() / 2)));
  System.out.println("Creating Jet instance 1");
  jet = Jet.newJetInstance(cfg);
  System.out.println("Creating Jet instance 2");
  Jet.newJetInstance(cfg);
  System.out.println("These books will be indexed:");
  buildDocumentInventory();
}

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

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();
}

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

/**
 * Creates a server instance of Hazelcast Jet. If the system property
 * {@code print.port} is set, the server writes the port number of the
 * Hazelcast instance to a file named by the property.
 */
public static void main(String[] args) throws Exception {
  configureLogging();
  JetInstance jet = Jet.newJetInstance();
  printMemberPort(jet.getHazelcastInstance());
}

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

public static void main(String[] args) {
  JetInstance jet = Jet.newJetInstance();
  Pipeline p = buildPipeline();
  System.out.println("Generating model...");
  try {
    jet.newJob(p).join();
    printTransitionsAndMarkovChain(jet);
  } finally {
    Jet.shutdownAll();
  }
}

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

/**
   * {@code JetInstance} bean which configured programmatically with {@code SpringManagedContext}
   */
  @Bean
  public JetInstance instance() {
    Config config = new Config()
        .setManagedContext(managedContext());
    JetConfig jetConfig = new JetConfig()
        .setHazelcastConfig(config);
    return Jet.newJetInstance(jetConfig);
  }
}

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

private void go() throws Exception {
  try {
    createAvroFile();
    JetInstance jet = Jet.newJetInstance();
    JobConf jobConfig = createJobConfig();
    jet.newJob(buildPipeline(jobConfig)).join();
  } finally {
    Jet.shutdownAll();
  }
}

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

public static void main(String[] args) {
  JetInstance jet = Jet.newJetInstance();
  Pipeline pipeline = buildPipeline();
  addListener(jet.getMap(TAKE_OFF_MAP), a -> System.out.println("New aircraft taking off: " + a));
  addListener(jet.getMap(LANDING_MAP), a -> System.out.println("New aircraft landing " + a));
  try {
    Job job = jet.newJob(pipeline, new JobConfig().setName("FlightTelemetry").setProcessingGuarantee(ProcessingGuarantee.EXACTLY_ONCE));
    job.join();
  } finally {
    Jet.shutdownAll();
  }
}

相关文章