[
https://issues.apache.org/jira/browse/YARN-11484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17773829#comment-17773829
]
ASF GitHub Bot commented on YARN-11484:
---------------------------------------
goiri commented on code in PR #6132:
URL: https://github.com/apache/hadoop/pull/6132#discussion_r1353390005
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java:
##########
@@ -1969,6 +1971,98 @@ public void testGetQueueInfoWithEmptyNodeLabel() throws
Exception {
String queueInfoStr = baos.toString("UTF-8");
Assert.assertEquals(queueInfoStr, sysOutStream.toString());
}
+
+ @Test
+ public void testGetQueueInfoWithFairScheduler() throws Exception {
+ // In this test case, we will simulate the queue information of
fairScheduler
+ // and check the results of the queue information.
+ QueueCLI cli = createAndGetQueueCLI();
+ RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
+ QueueInfo queueInfo = recordFactory.newRecordInstance(QueueInfo.class);
+ queueInfo.setQueueName("queueA");
+ queueInfo.setSchedulerType("FairScheduler");
+ queueInfo.setQueueState(QueueState.RUNNING);
+ queueInfo.setCapacity(0.3f);
+ queueInfo.setCurrentCapacity(0.1f);
+ queueInfo.setWeight(0.3f);
+ queueInfo.setMinResourceVCore(1);
+ queueInfo.setMinResourceMemory(1024);
+ queueInfo.setMaxResourceVCore(10);
+ queueInfo.setMaxResourceMemory(8192);
+ queueInfo.setReservedResourceVCore(0);
+ queueInfo.setReservedResourceMemory(0);
+ queueInfo.setSteadyFairShareVCore(10);
+ queueInfo.setSteadyFairShareMemory(8192);
+ queueInfo.setMaxRunningApp(10);
+ queueInfo.setPreemptionDisabled(true);
+ when(client.getQueueInfo(any(String.class))).thenReturn(queueInfo);
+ int result = cli.run(new String[] { "-status", "queueA" });
+ assertEquals(0, result);
+ verify(client).getQueueInfo("queueA");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(baos);
+ pw.println("Queue Information : ");
+ pw.println("Scheduler Name : FairScheduler");
+ pw.println("Queue Name : " + "queueA");
+ pw.println("\tWeight : " + "0.30");
+ pw.println("\tState : " + "RUNNING");
+ pw.println("\tMinResource : " + "<memory : 0, vCores:10>");
+ pw.println("\tMaxResource : " + "<memory : 8192, vCores:0>");
Review Comment:
Why not just a single one without the +?
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java:
##########
@@ -1174,6 +1174,22 @@ public void testGetQueueInfo() throws Exception {
Assert.assertEquals(queueInfo.getAccessibleNodeLabels().size(), 1);
}
+ @Test
+ public void testSubClusterGetQueueInfo() throws IOException, YarnException {
+ // We have set up a unit test where we access queue information for
subcluster1.
+ GetQueueInfoResponse response = interceptor.getQueueInfo(
+ GetQueueInfoRequest.newInstance("root", true, true, true, "1"));
+ Assert.assertNotNull(response);
+
+ QueueInfo queueInfo = response.getQueueInfo();
+ Assert.assertNotNull(queueInfo);
+ Assert.assertEquals(queueInfo.getQueueName(), "root");
Review Comment:
Usually expected is first.
> [Federation] Router Supports Yarn Client CLI Cmds.
> --------------------------------------------------
>
> Key: YARN-11484
> URL: https://issues.apache.org/jira/browse/YARN-11484
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: federation
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Major
> Labels: pull-request-available
>
> This Jira ticket aims to enhance the Router command by adding support for all
> Yarn Client CLI options.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]