You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2017/06/30 10:51:00 UTC

[jira] [Commented] (HBASE-15501) MultiAction.add creates unnecessary temporary objects

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

Hadoop QA commented on HBASE-15501:
-----------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  0m  0s{color} | {color:blue} Docker mode activated. {color} |
| {color:red}-1{color} | {color:red} patch {color} | {color:red}  0m  5s{color} | {color:red} HBASE-15501 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/0.4.0/precommit-patchnames for help. {color} |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | HBASE-15501 |
| JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12794579/HBASE-15501-v1.patch |
| Console output | https://builds.apache.org/job/PreCommit-HBASE-Build/7421/console |
| Powered by | Apache Yetus 0.4.0   http://yetus.apache.org |


This message was automatically generated.



> MultiAction.add creates unnecessary temporary objects
> -----------------------------------------------------
>
>                 Key: HBASE-15501
>                 URL: https://issues.apache.org/jira/browse/HBASE-15501
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>    Affects Versions: 2.0.0
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>         Attachments: HBASE-15501-v1.patch
>
>
> MultiAction class:
> {code}
>   /**
>    * Add an Action to this container based on it's regionName. If the regionName
>    * is wrong, the initial execution will fail, but will be automatically
>    * retried after looking up the correct region.
>    *
>    * @param regionName
>    * @param a
>    */
>   public void add(byte[] regionName, Action<R> a) {
>     add(regionName, Arrays.asList(a));
>   }
>   /**
>    * Add an Action to this container based on it's regionName. If the regionName
>    * is wrong, the initial execution will fail, but will be automatically
>    * retried after looking up the correct region.
>    *
>    * @param regionName
>    * @param actionList list of actions to add for the region
>    */
>   public void add(byte[] regionName, List<Action<R>> actionList){
>     List<Action<R>> rsActions = actions.get(regionName);
>     if (rsActions == null) {
>       rsActions = new ArrayList<Action<R>>(actionList.size());
>       actions.put(regionName, rsActions);
>     }
>     rsActions.addAll(actionList);
>   }
> {code}
> Avoid Arrays.asList(a) and Collection.addAll - they create temporary garbage



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