/** * Creates a new set with the same elements as the given collection. The * collection is created with a capacity of twice the number of mappings in * the given map or 11 (whichever is greater), and a default load factor * and concurrencyLevel. * * @param c Collection to add. */ public GridConcurrentHashSet(Collection<E> c) { super(new ConcurrentHashMap<E, E>(c.size())); addAll(c); }
/** */ @Override public void run() { try { JobStealingResult res = ignite.compute().execute(new JobStealingTask(2), null); info("Task result: " + res); stolen.addAndGet(res.stolen); noneStolen.addAndGet(res.nonStolen); nodes.addAll(res.nodes); } catch (IgniteException e) { log.error("Failed to execute task.", e); fail.getAndSet(e); } } }, threadsNum, "JobStealingThread");
/** */ @Override public void run() { try { final IgniteCompute compute = ignite.compute().withAsync(); compute.execute(new JobStealingTask(jobsPerTask), null); JobStealingResult res = (JobStealingResult)compute.future().get(); info("Task result: " + res); stolen.addAndGet(res.stolen); noneStolen.addAndGet(res.nonStolen); nodes.addAll(res.nodes); } catch (IgniteException e) { log.error("Failed to execute task.", e); fail.getAndSet(e); } } }, threadsNum, "JobStealingThread");
/** * Creates a new set with the same elements as the given collection. The * collection is created with a capacity of twice the number of mappings in * the given map or 11 (whichever is greater), and a default load factor * and concurrencyLevel. * * @param c Collection to add. */ public GridConcurrentHashSet(Collection<E> c) { super(new ConcurrentHashMap<E, E>(c.size())); addAll(c); }