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

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

                Author: ASF GitHub Bot
            Created on: 15/Nov/19 14:35
            Start Date: 15/Nov/19 14:35
    Worklog Time Spent: 10m 
      Work Description: adoroszlai commented on pull request #183: HDDS-2505. 
Fix logic related to SCM address calculation in HddsUtils
URL: https://github.com/apache/hadoop-ozone/pull/183
 
 
   ## What changes were proposed in this pull request?
   
    * Get rid of unreachable `if` branches in `HddsUtils` methods, as reported 
by Sonar
    * Reduce duplication:
      * `getHostNameFromConfigKeys` already supports multiple keys for fallback
      * extract the exception about unsupported multi-SCM
    * Use `OptionalInt` instead of `Optional<Integer>` for ports
    * Move usage of config key and its default value closer
    * Remove unused `getScmServiceRpcAddresses()`
    * Flip `assertEquals` args
    * Avoid `String.format` in logging
    * Remove `@param` without description
   
   https://issues.apache.org/jira/browse/HDDS-2505
   
   ## How was this patch tested?
   
   Unit tests (host/port lookup has good coverage).  Also ran `ozone` 
acceptance test locally.
 
----------------------------------------------------------------
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:
[email protected]


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

            Worklog Id:     (was: 344295)
    Remaining Estimate: 0h
            Time Spent: 10m

> Fix logic related to SCM address calculation in HddsUtils
> ---------------------------------------------------------
>
>                 Key: HDDS-2505
>                 URL: https://issues.apache.org/jira/browse/HDDS-2505
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: SCM
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Major
>              Labels: pull-request-available, sonar
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{HddsUtils}} has 3 methods to calculate SCM address for various client 
> types.  All have an unreachable {{if}} branch, because:
> # {{iterator().next()}} throws exception for empty list
> # {{getSCMAddresses}} never returns empty list anyway, it throws exception
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPX&open=AW5md-4qKcVY8lQ4ZsPX
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPY&open=AW5md-4qKcVY8lQ4ZsPY
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPW&open=AW5md-4qKcVY8lQ4ZsPW
> Ideally code duplication among these methods should be reduced, too.
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPU&open=AW5md-4qKcVY8lQ4ZsPU
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPT&open=AW5md-4qKcVY8lQ4ZsPT
> * 
> https://sonarcloud.io/project/issues?id=hadoop-ozone&issues=AW5md-4qKcVY8lQ4ZsPV&open=AW5md-4qKcVY8lQ4ZsPV
> Complete list of issues in the same file:
> https://sonarcloud.io/project/issues?fileUuids=AW5md-HhKcVY8lQ4Zrjn&id=hadoop-ozone&resolved=false



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to