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("Loading The Complete Works of William Shakespeare"); try { long[] lineNum = {0}; Map<Long, String> bookLines = new HashMap<>(); Path book = Paths.get(getClass().getResource("books/shakespeare-complete-works.txt").toURI()); Files.lines(book).forEach(line -> bookLines.put(++lineNum[0], line)); jet.getMap(BOOK_LINES).putAll(bookLines); } catch (IOException | URISyntaxException e) { throw new RuntimeException(e); } }