hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-12060) Replace enhanced for statement with basic for statement where possible
Date Wed, 24 Sep 2014 06:05:34 GMT

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

Lars Hofhansl commented on HBASE-12060:
---------------------------------------

Looking around... FilterList is a very bad offender it seems. It's potentially called many
time per row (different methods) and each of them creates an iterator.

> Replace enhanced for statement with basic for statement where possible
> ----------------------------------------------------------------------
>
>                 Key: HBASE-12060
>                 URL: https://issues.apache.org/jira/browse/HBASE-12060
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Andrew Purtell
>              Labels: beginner, beginners
>
> Wherever we use the enhanced for construction:
> {noformat}
>     for ( FormalParameter : Expression ) Statement
> {noformat}
> where the Expression evaluates to an array or collection type that supports random access,
we can avoid creating iterator objects, unless we are also using the iterator to remove items
while iterating by using the basic for statement instead:
> {noformat}
> for ( ForInit ; Expression ; ForUpdate ) Statement
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message