[
https://issues.apache.org/jira/browse/HDFS-16481?focusedWorklogId=734749&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-734749
]
ASF GitHub Bot logged work on HDFS-16481:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Mar/22 16:26
Start Date: 01/Mar/22 16:26
Worklog Time Spent: 10m
Work Description: virajjasani commented on a change in pull request #4028:
URL: https://github.com/apache/hadoop/pull/4028#discussion_r816932592
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/qjournal/TestMiniJournalCluster.java
##########
@@ -52,4 +59,82 @@ public void testStartStop() throws IOException {
c.shutdown();
}
}
+
+ @Test
+ public void testStartStopWithPorts() throws Exception {
+ Configuration conf = new Configuration();
+
+ LambdaTestUtils.intercept(
+ IllegalArgumentException.class,
+ "Num of http ports (1) should match num of JournalNodes (3)",
+ "MiniJournalCluster port validation failed",
+ () -> {
+ new MiniJournalCluster.Builder(conf).setHttpPorts(8481).build();
+ });
+
+ LambdaTestUtils.intercept(
+ IllegalArgumentException.class,
+ "Num of rpc ports (2) should match num of JournalNodes (3)",
+ "MiniJournalCluster port validation failed",
+ () -> {
+ new MiniJournalCluster.Builder(conf).setRpcPorts(8481, 8482).build();
+ });
+
+ LambdaTestUtils.intercept(
+ IllegalArgumentException.class,
+ "Num of rpc ports (1) should match num of JournalNodes (3)",
+ "MiniJournalCluster port validation failed",
+ () -> {
+ new MiniJournalCluster.Builder(conf).setHttpPorts(800, 9000,
10000).setRpcPorts(8481)
+ .build();
+ });
+
+ LambdaTestUtils.intercept(
+ IllegalArgumentException.class,
+ "Num of http ports (4) should match num of JournalNodes (3)",
+ "MiniJournalCluster port validation failed",
+ () -> {
+ new MiniJournalCluster.Builder(conf).setHttpPorts(800, 9000, 1000,
2000)
+ .setRpcPorts(8481, 8482, 8483).build();
+ });
+
+ final int[] httpPorts = new int[] { NetUtils.getFreeSocketPort(),
NetUtils.getFreeSocketPort(),
+ NetUtils.getFreeSocketPort() };
+ final int[] rpcPorts = new int[] { NetUtils.getFreeSocketPort(),
NetUtils.getFreeSocketPort(),
+ NetUtils.getFreeSocketPort() };
Review comment:
I see the exact increments in the ports as per the logs:
```
2022-03-01 20:08:22,504 [Listener at localhost/58862] INFO
qjournal.TestMiniJournalCluster
(TestMiniJournalCluster.java:testStartStopWithPorts(106)) - Http ports
selected: [58873, 58874, 58875]
2022-03-01 20:08:22,504 [Listener at localhost/58862] INFO
qjournal.TestMiniJournalCluster
(TestMiniJournalCluster.java:testStartStopWithPorts(107)) - Rpc ports selected:
[58876, 58877, 58878]
2022-03-01 21:53:55,768 [Listener at localhost/59292] INFO
qjournal.TestMiniJournalCluster
(TestMiniJournalCluster.java:testStartStopWithPorts(106)) - Http ports
selected: [59302, 59303, 59304]
2022-03-01 21:53:55,768 [Listener at localhost/59292] INFO
qjournal.TestMiniJournalCluster
(TestMiniJournalCluster.java:testStartStopWithPorts(107)) - Rpc ports selected:
[59305, 59306, 59307]
```
And so on..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 734749)
Time Spent: 3h (was: 2h 50m)
> Provide support to set Http and Rpc ports in MiniJournalCluster
> ---------------------------------------------------------------
>
> Key: HDFS-16481
> URL: https://issues.apache.org/jira/browse/HDFS-16481
> Project: Hadoop HDFS
> Issue Type: Task
> Reporter: Viraj Jasani
> Assignee: Viraj Jasani
> Priority: Major
> Labels: pull-request-available
> Time Spent: 3h
> Remaining Estimate: 0h
>
> We should provide support for clients to set Http and Rpc ports of
> JournalNodes in MiniJournalCluster.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]