ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qiang Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (RANGER-1859) Fix new findBugs in HdfsClient.java
Date Fri, 27 Oct 2017 07:13:00 GMT

    [ https://issues.apache.org/jira/browse/RANGER-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16221842#comment-16221842
] 

Qiang Zhang commented on RANGER-1859:
-------------------------------------

Review Requet:
https://reviews.apache.org/r/63351/

Solution patch, please see attachment:
[patch|https://issues.apache.org/jira/secure/attachment/12894295/0001-RANGER-1859-Fix-new-findBugs-in-HdfsClient.java.patch]

> Fix new findBugs in HdfsClient.java
> -----------------------------------
>
>                 Key: RANGER-1859
>                 URL: https://issues.apache.org/jira/browse/RANGER-1859
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 1.0.0
>            Reporter: Qiang Zhang
>            Assignee: Qiang Zhang
>              Labels: findbugs, patch
>             Fix For: 1.0.0
>
>         Attachments: 0001-RANGER-1859-Fix-new-findBugs-in-HdfsClient.java.patch
>
>
> There is FindBugs: Performance  (FB.SBSC_USE_STRINGBUFFER_CONCATENATION) in org.apache.ranger.services.hdfs.client.HdfsClient.validateConnectionConfigs(Map<String,
String>)
> {code}
> if (fsDefaultNameElements != null && fsDefaultNameElements.length >= 2) {
> 	String cluster = "";
> 	StringBuffer clusters = new StringBuffer();
> 	configs.put("dfs.nameservices", "hdfscluster");
> 	configs.put("fs.default.name", "hdfs://" + configs.get("dfs.nameservices"));
> 	configs.put("dfs.client.failover.proxy.provider." + configs.get("dfs.nameservices"),
> 			"org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");
> 	for (int i = 0; i < fsDefaultNameElements.length; i++) {
> 		cluster = "namenode" + (i + 1);
> 		configs.put("dfs.namenode.rpc-address." + configs.get("dfs.nameservices") + "." + cluster,
> 				fsDefaultNameElements[i]);
> 		if (i == (fsDefaultNameElements.length - 1)) {
> 				clusters.append(cluster);
> 		} else {
> 				clusters.append(cluster).append(",");
> 		}
> 	}
> 	configs.put("dfs.ha.namenodes." + configs.get("dfs.nameservices"), clusters.toString());
> }
> {code}
> To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZSbhom32dlDl11LWEm9nX11zsOWMf5dv3Q9Mogo-2FGua3FsLRTFft2V-2FOFC9o0P2e0-3D_d04ZgyDzSjlwpjXIuOFYDNE6R93Lal83MDClQK32PZtwvLNyXEpALHHKXqGKvroU5mWNsNiM7OVRdsl6DJR5LTUChq42fVbU-2Fr1jlwSSZ3yR3k4ycwZTS0QkKayVUGYhpHjV8vMdPHJwfZIZjeDvW59RoGHYuxr3UvsJzGHNk6gAvr6OuaH0vx6ZtLRw-2F0NLST5sMrn2kXHvdALOtTEjnQ-3D-3D



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message