[jira] [Updated] (HBASE-19702) Improve RSGroupInfo constructor

2018-01-05 Thread Xiang Li (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-19702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-19702:
-
Description: 
{code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java|borderStyle=solid}
RSGroupInfo(String name, SortedSet servers, SortedSet 
tables) {
this.name = name;
this.servers = servers == null? new TreeSet<>(): servers;
this.servers.addAll(servers);
this.tables = new TreeSet<>(tables);
}
{code}

2 improvements could be made:
* When servers is not null, addAll(servers) tries to add all items in servers 
again. Seems not needed
* new TreeSet<>(tables) has no null check on tables. The constructor of TreeSet 
does not do the null check either. It leads to NullPointerException if tables 
is null

> Improve RSGroupInfo constructor
> ---
>
> Key: HBASE-19702
> URL: https://issues.apache.org/jira/browse/HBASE-19702
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Fix For: 2.0.0-beta-2
>
>
> {code:title=hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java|borderStyle=solid}
> RSGroupInfo(String name, SortedSet servers, SortedSet 
> tables) {
> this.name = name;
> this.servers = servers == null? new TreeSet<>(): servers;
> this.servers.addAll(servers);
> this.tables = new TreeSet<>(tables);
> }
> {code}
> 2 improvements could be made:
> * When servers is not null, addAll(servers) tries to add all items in servers 
> again. Seems not needed
> * new TreeSet<>(tables) has no null check on tables. The constructor of 
> TreeSet does not do the null check either. It leads to NullPointerException 
> if tables is null



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


[jira] [Updated] (HBASE-19702) Improve RSGroupInfo constructor

2018-01-03 Thread Chia-Ping Tsai (JIRA)

 [ 
https://issues.apache.org/jira/browse/HBASE-19702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai updated HBASE-19702:
---
Fix Version/s: 2.0.0-beta-2

> Improve RSGroupInfo constructor
> ---
>
> Key: HBASE-19702
> URL: https://issues.apache.org/jira/browse/HBASE-19702
> Project: HBase
>  Issue Type: Improvement
>Reporter: Xiang Li
>Assignee: Xiang Li
>Priority: Minor
> Fix For: 2.0.0-beta-2
>
>




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