hanishakoneru commented on a change in pull request #792: HDDS-1474. ozone.scm.datanode.id config should take path for a dir URL: https://github.com/apache/hadoop/pull/792#discussion_r280814733
########## File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/hdds/scm/HddsServerUtil.java ########## @@ -380,18 +380,19 @@ public static String getDefaultRatisDirectory(Configuration conf) { * @return the path of datanode id as string */ public static String getDatanodeIdFilePath(Configuration conf) { - String dataNodeIDPath = conf.get(ScmConfigKeys.OZONE_SCM_DATANODE_ID); - if (dataNodeIDPath == null) { + String dataNodeIDDirPath = conf.get(ScmConfigKeys.OZONE_SCM_DATANODE_ID); + if (dataNodeIDDirPath == null) { File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf); if (metaDirPath == null) { // this means meta data is not found, in theory should not happen at // this point because should've failed earlier. throw new IllegalArgumentException("Unable to locate meta data" + "directory when getting datanode id path"); } - dataNodeIDPath = new File(metaDirPath, - ScmConfigKeys.OZONE_SCM_DATANODE_ID_PATH_DEFAULT).toString(); + dataNodeIDDirPath = metaDirPath.toString(); } - return dataNodeIDPath; + // Use default datanode id file name for file path + return new File(dataNodeIDDirPath, + ScmConfigKeys.OZONE_SCM_DATANODE_ID_PATH_DEFAULT).toString(); Review comment: OZONE_SCM_DATANODE_ID_PATH_DEFAULT is now a constant as it is not configurable. We should move it to OzoneConsts. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org