[
https://issues.apache.org/jira/browse/HDFS-17888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062115#comment-18062115
]
ASF GitHub Bot commented on HDFS-17888:
---------------------------------------
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
> Fix MiniCluster startup & HttpServer service's conf issues.
> -----------------------------------------------------------
>
> Key: HDFS-17888
> URL: https://issues.apache.org/jira/browse/HDFS-17888
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Zhaobo Huang
> Assignee: Zhaobo Huang
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]