[ 
https://issues.apache.org/jira/browse/HDDS-1891?focusedWorklogId=288322&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-288322
 ]

ASF GitHub Bot logged work on HDDS-1891:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Aug/19 23:09
            Start Date: 02/Aug/19 23:09
    Worklog Time Spent: 10m 
      Work Description: bharatviswa504 commented on 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 288322)
    Time Spent: 0.5h  (was: 20m)

> Ozone fs shell command should work with default port when port number is not 
> specified
> --------------------------------------------------------------------------------------
>
>                 Key: HDDS-1891
>                 URL: https://issues.apache.org/jira/browse/HDDS-1891
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {code:bash|title=Without port number -> Error}
> $ ozone fs -ls o3fs://bucket.volume.localhost/
> -ls: Ozone file system url should be either one of the two forms: 
> o3fs://bucket.volume/key  OR o3fs://bucket.volume.om-host.example.com:5678/key
> ...
> {code}
> {code:bash|title=With port number -> Success}
> $ ozone fs -ls o3fs://bucket.volume.localhost:9862/
> Found 1 items
> -rw-rw-rw-   1 hadoop hadoop       1485 2019-08-01 21:14 
> o3fs://bucket.volume.localhost:9862/README.txt
> {code}
> We expect the first command to attempt port 9862 by default.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to