@Override public T next() { if (itemReturned) { return Traverser.this.next(); } itemReturned = true; return item; } };
private static String formatJob(Job job) { return "id=" + idToString(job.getId()) + ", name=" + job.getName() + ", submissionTime=" + toLocalDateTime(job.getSubmissionTime()); }
/** * Returns map name in the form {@code "_jet.snapshot.<jobId>.<dataMapIndex>"}. */ public static String snapshotDataMapName(long jobId, int dataMapIndex) { return SNAPSHOT_DATA_MAP_PREFIX + idToString(jobId) + '.' + dataMapIndex; }
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(); } }
private void go() { try { setup(); jet.newJob(buildPipeline()).join(); } finally { Jet.shutdownAll(); } }
private void setup() { jet = Jet.newJetInstance(); Jet.newJetInstance(); IMapJet<String, User> map = jet.getMap(MAP_NAME); for (int i = 0; i < 100; i++) { User user = new User("User" + i, "pass" + i, i, i % 2 == 0); map.put(user.getUsername(), user); } }
/** * 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()); }
private static JetInstance startLocalJetCluster() { JetInstance localJet = Jet.newJetInstance(); Jet.newJetInstance(); return localJet; }
/** * Destroy the underlying distributed object. */ public void destroy() { instance.getMap(exportedSnapshotMapName(name)).destroy(); instance.getMap(JobRepository.EXPORTED_SNAPSHOTS_DETAIL_CACHE).delete(name); } }
private static Entry<String, Collection<Entry<String, Double>>> toInvertedIndexEntry( double logDocCount, String word, Collection<Entry<String, Long>> docIdTfs ) { return entry(word, docScores(logDocCount, docIdTfs)); }
private static Job getJob(JetInstance jet, String nameOrId) { Job job = jet.getJob(nameOrId); if (job == null) { job = jet.getJob(Util.idFromString(nameOrId)); if (job == null) { throw new JobNotFoundException("No job with name or id '" + nameOrId + "' was found"); } } return job; }
@Bean public JetInstance jetClient() { return Jet.newJetClient(clientConfig); } }
/** * Returns the string representation of this job's ID */ @Nonnull default String getIdString() { return Util.idToString(getId()); }
private void go() throws Exception { try { createAvroFile(); JetInstance jet = Jet.newJetInstance(); JobConf jobConfig = createJobConfig(); jet.newJob(buildPipeline(jobConfig)).join(); } finally { Jet.shutdownAll(); } }
private static JetInstance startLocalJetCluster() { JetInstance localJet = Jet.newJetInstance(); Jet.newJetInstance(); return localJet; }