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

Chia-Ping Tsai commented on HBASE-20528:
----------------------------------------

{code}
-        for (int i = 0; i < this.curFunctionCosts.length; i++) {
-          curFunctionCosts[i] = tempFunctionCosts[i];
-        }
+        curFunctionCosts = Arrays.copyOf(tempFunctionCosts, 
this.curFunctionCosts.length);
{code}
seems this change makes a duplicate clone of curFunctionCosts...(since 
curFunctionCosts is initialized by StochasticLoadBalancer.setConf). Could you 
please revert it? sorry for my previous comments :(

> Revise collections copying from iteration to built-in function
> --------------------------------------------------------------
>
>                 Key: HBASE-20528
>                 URL: https://issues.apache.org/jira/browse/HBASE-20528
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>            Reporter: Hua-Yi Ho
>            Assignee: Hua-Yi Ho
>            Priority: Minor
>             Fix For: 3.0.0
>
>         Attachments: HBASE-20528.master.001.patch
>
>
> Some collection codes in file
> StochasticLoadBalancer.java, AbstractHBaseTool.java, HFileInputFormat.java, 
> Result.java, and WalPlayer.java, using iterations to copy whole data in 
> collections. The iterations can just replace by just Colletions.addAll and 
> Arrays.copyOf.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to