steveloughran commented on code in PR #8289:
URL: https://github.com/apache/hadoop/pull/8289#discussion_r2871966435
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java:
##########
@@ -221,8 +221,9 @@ public static File getTestDir() {
prop = DEFAULT_TEST_DATA_DIR;
}
File dir = new File(prop).getAbsoluteFile();
- dir.mkdirs();
- assertExists(dir);
+ if (dir.mkdirs() && !dir.exists()) {
+ throw new IllegalArgumentException("File " + dir + " should exist");
Review Comment:
nit: change to "Directory not created" and throw IllegalStateException
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDatanodeConfig.java:
##########
@@ -167,4 +169,23 @@ public void testMemlockLimit() throws Exception {
prevLimit);
}
}
+
+ @Test
+ public void testDataNodeIpcAndHttpSeverConf() throws Exception {
+ Configuration conf = cluster.getConfiguration(0);
+ DataNode dn = null;
+ try {
+ dn = DataNode.createDataNode(new String[] {}, conf);
+ Configuration dnConf = dn.getConf();
+ InetSocketAddress listenerAddress = dn.ipcServer.getListenerAddress();
+ assertEquals(dnConf.get(DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_KEY),
Review Comment:
can you use AssertJ.assertEquals and incide a message about which config
option is wrong. AssertJ backports to older branches, jupiter assertions don't
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java:
##########
@@ -303,7 +303,9 @@ public void start() throws IOException {
if (httpServer != null) {
InetSocketAddress infoAddr = DataNode.getInfoAddr(conf);
httpAddress = getChannelLocalAddress(httpServer, infoAddr);
- LOG.info("Listening HTTP traffic on " + httpAddress);
+ conf.set(DFSConfigKeys.DFS_DATANODE_HTTP_ADDRESS_KEY,
+ NetUtils.getHostPortString(httpAddress));
+ LOG.info("Listening HTTP traffic on {}", httpAddress);
Review Comment:
nit: can you say "Listening for " here and below
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]