Refine search
/** * Tests that a job is not cancelled if there are no * available thief nodes in projection. * * @throws Exception If failed. */ @Test public void testSingleNodeProjection() throws Exception { ClusterGroup prj = ignite1.cluster().forNodeIds(Collections.singleton(ignite1.cluster().localNode().id())); executeAsync(compute(prj), new JobStealingSpreadTask(2), null).get(TASK_EXEC_TIMEOUT_MS); assertEquals(1, jobDistrMap.keySet().size()); assertEquals(2, jobDistrMap.get(ignite1.cluster().localNode().id()).size()); }
/** * Test 2 jobs on 1 node with null predicate using string task name. * * @throws IgniteCheckedException If test failed. */ @Test public void testTwoJobsTaskNameNullPredicate() throws IgniteCheckedException { executeAsync(ignite1.compute(), JobStealingSingleNodeTask.class.getName(), null).get(TASK_EXEC_TIMEOUT_MS); // Verify that 1 job was stolen by second node. assertEquals(2, jobDistrMap.keySet().size()); assertEquals(1, jobDistrMap.get(ignite1.cluster().localNode().id()).size()); assertEquals(1, jobDistrMap.get(ignite2.cluster().localNode().id()).size()); }
/** * Test 2 jobs on 1 node. * * @throws IgniteCheckedException If test failed. */ @Test public void testTwoJobs() throws IgniteCheckedException { executeAsync(ignite1.compute(), new JobStealingSingleNodeTask(2), null).get(TASK_EXEC_TIMEOUT_MS); // Verify that 1 job was stolen by second node. assertEquals(2, jobDistrMap.keySet().size()); assertEquals(1, jobDistrMap.get(ignite1.cluster().localNode().id()).size()); assertEquals(1, jobDistrMap.get(ignite2.cluster().localNode().id()).size()); }
/** * Test 2 jobs on 1 node with null predicate. * * @throws IgniteCheckedException If test failed. */ @Test public void testTwoJobsNullPredicate() throws IgniteCheckedException { executeAsync(ignite1.compute(), new JobStealingSingleNodeTask(2), null).get(TASK_EXEC_TIMEOUT_MS); // Verify that 1 job was stolen by second node. assertEquals(2, jobDistrMap.keySet().size()); assertEquals(1, jobDistrMap.get(ignite1.cluster().localNode().id()).size()); assertEquals(1, jobDistrMap.get(ignite2.cluster().localNode().id()).size()); }
/** * Resolves TensorFlow cluster chief job and acquires ports. * * @param spec TensorFlow cluster specification. */ private void resolveAndAcquirePortsForChief(TensorFlowClusterSpec spec) { ClusterNode chiefNode = ignite.cluster().localNode(); UUID chiefNodeId = chiefNode.id(); int chiefPort = portMgr.acquirePort(chiefNodeId); spec.addTask(CHIEF_JOB_NAME, chiefNodeId, chiefPort); } }
/** * @param g Grid. * @param tm Transaction manager. */ private void checkTm(Ignite g, IgniteTxManager tm) { Collection<IgniteInternalTx> txs = tm.activeTransactions(); info(">>> Number of transactions in the set [size=" + txs.size() + ", nodeId=" + g.cluster().localNode().id() + ']'); for (IgniteInternalTx tx : txs) assert tx.done() : "Transaction is not finished: " + tx; } }
/** * @throws Exception In case of error. */ @Test public void testRemoteNodeEventStorage() throws Exception { IgnitePredicate<Event> filter = new TestEventFilter(); generateEvents(ignite2); ClusterGroup prj = ignite1.cluster().forPredicate(F.remoteNodes(ignite1.cluster().localNode().id())); Collection<Event> evts = events(prj).remoteQuery(filter, 0); assert evts != null; assert evts.size() == 1; }