hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] bharatviswa504 commented on a change in pull request #1218: HDDS-1891. Ozone fs shell command should work with default port when port number is not specified
Date Fri, 02 Aug 2019 23:09:28 GMT
bharatviswa504 commented on a change in pull request #1218: HDDS-1891. Ozone fs shell command
should work with default port when port number is not specified
URL: https://github.com/apache/hadoop/pull/1218#discussion_r310322479
 
 

 ##########
 File path: hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
 ##########
 @@ -113,11 +115,14 @@ public void initialize(URI name, Configuration conf) throws IOException
{
     String omPort = String.valueOf(-1);
     if (!isEmpty(remaining)) {
       String[] parts = remaining.split(":");
-      if (parts.length != 2) {
+      // Array length should only be 1 or 2
+      if (parts.length > 2) {
         throw new IllegalArgumentException(URI_EXCEPTION_TEXT);
       }
       omHost = parts[0];
-      omPort = parts[1];
+      // If port number is not specified, try default OM port
+      omPort = parts.length == 2 ?
+          parts[1] : String.valueOf(OZONE_OM_PORT_DEFAULT);
 
 Review comment:
   Here do we need to use configuration.get(OZONE_OM_PORT, OZONE_OM_PORT_DEFAULT).
   To support a case for reading default value from configuration.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message