I'm using Hazelcast Jet to do calculations over a large number of elements (~ 480 million).
I'm starting using an IMap Sink containing the starting data. I'm filling the map using
Collections2.permutations(initialPermutation).parallelStream().forEach(set -> {
Permutation permutation = new Permutation(set);
permutations.put(permutation.toString(), permutation);
});
where Permutation is a simple data class and set is a List of Integers. When running this parallel stream I'm getting the following exception:
java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker
and I don't know how to fix it.