/** * Roulette Wheel selection * * @param map Map of keys/fitness scores * @return List of primary Keys for respective chromosomes that will breed */ private List<Long> selectByRouletteWheel(LinkedHashMap map) { List<Long> populationKeys = this.ignite.compute().execute(new RouletteWheelSelectionTask(this.cfg), map); return populationKeys; }
/** {@inheritDoc} */ @Override public String executeTask(String taskName, String arg) throws JMException { try { return compute().execute(taskName, arg); } catch (IgniteException e) { throw U.jmException(e); } }
/** * Calculate fitness each Chromosome in population * * @param chromosomeKeys List of chromosome primary keys */ private void calculateFitness(List<Long> chromosomeKeys) { this.ignite.compute().execute(new FitnessTask(this.cfg), chromosomeKeys); }
/** {@inheritDoc} */ @Override public void restartNodes() throws IgniteException { guard(); try { compute().execute(IgniteKillTask.class, true); } finally { unguard(); } }
@Nullable @Override public Object call() { try { rmts.execute(GridJobExecutionLoadTestTask.class, null); } catch (IgniteException e) { e.printStackTrace(); } return null; } }, noThreads, WARM_UP_DURATION);
/** {@inheritDoc} */ @Override public void stopNodes() throws IgniteException { guard(); try { compute().execute(IgniteKillTask.class, false); } finally { unguard(); } }
@Override public Object call() throws Exception { grid().compute().execute(new FailedTask(), null); return null; } },
/** * @throws Exception If test failed. */ @Test public void testMany() throws Exception { ignite1.compute().execute(GridCacheLoadPopulationTask.class, null); } }
/** {@inheritDoc} */ @Override public void stopNodes(Collection<UUID> ids) throws IgniteException { guard(); try { ctx.grid().compute(forNodeIds(ids)).execute(IgniteKillTask.class, false); } finally { unguard(); } }
/** * Test 2 jobs on 2 nodes. * * @throws IgniteCheckedException If test failed. */ @Test public void testTwoJobs() throws IgniteCheckedException { ignite1.compute().execute(JobStealingTask.class, null); }
/** {@inheritDoc} */ @Override public void restartNodes(Collection<UUID> ids) throws IgniteException { guard(); try { ctx.grid().compute(forNodeIds(ids)).execute(IgniteKillTask.class, true); } finally { unguard(); } }
/** * @throws Exception If failed. */ @Test public void testClass() throws Exception { assert grid().compute().execute(TestTask.class, null).equals(TASK_NAME); }
/** * @throws Exception If failed. */ @Test public void testInstance() throws Exception { assert grid().compute().execute(new TestTask(), null).equals(TASK_NAME); }
/** * @throws Exception If failed. */ @Test public void testFailover() throws Exception { grid(1).compute().execute(FailoverTestTask.class, null); }
@Override public Object call() throws Exception { grid().compute().withTimeout(100).execute(new TimedOutTask(), null); return null; } },
/** * @throws Exception If failed. */ @Test public void testTaskMap() throws Exception { Ignite ignite = G.ignite(getTestIgniteInstanceName()); info("Executing sync mapped task."); ignite.compute().execute(SyncMappedTask.class, null); info("Executing async mapped task."); ignite.compute().execute(AsyncMappedTask.class, null); }
/** */ private void checkExecuteException(IgniteException resE) throws Exception { try (Ignite ignite = startGrid()) { IgniteCompute compute = ignite.compute(); try { compute.execute(new ResultExceptionTask(resE), null); } catch (IgniteException e) { assertSame(resE, e); } } }
/** * @throws Exception If failed. */ @Test public void testCollisionSessionAttribute() throws Exception { Ignite ignite = G.ignite(getTestIgniteInstanceName()); ignite.compute().execute(GridSessionTestTask.class, null); info("Executed session collision test task."); }
/** * @throws Exception If failed. */ @Test public void testNoCacheResultMethodUsage() throws Exception { Ignite ignite = G.ignite(getTestIgniteInstanceName()); ignite.compute().withNoResultCache() .execute(GridResultNoCacheResultMethodTestTask.class, "Grid Result No Cache Method Test Argument"); }
/** * @throws Exception If test failed. */ @Test public void testCollisionJobContext() throws Exception { G.ignite(getTestIgniteInstanceName()).compute().execute(new GridTestTask(), "some-arg"); }