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

Lars Hofhansl commented on HBASE-12023:
---------------------------------------

I mean random accessible as in tagged with the RandomAccess interface. 
LinkedList has a get(index) but using that here would be very inefficient.

bq. (hopefully) will never be used in HBase
That's the worry I have. I've seen this happening in projects where folks 
expect an ArrayList but sometimes get LinkedLists and then the performance 
tanks.

Or in other words we now created an implicit dependency on the Lists here being 
ArrayList.

The correct way would be to change the definition in Mutation to 
{code}
  protected NavigableMap<byte [], ArrayList<Cell>> familyMap =
    new TreeMap<byte [], ArrayList<Cell>>(Bytes.BYTES_COMPARATOR);
{code}

Then we're structurally guaranteed that we have ArrayLists and made the 
dependency explicit.
Of course now that will break binary compatibility and so we cannot just change 
it.

Anyway... If I'm the only one worrying about this, let's commit.


> HRegion.applyFamilyMapToMemstore creates too many iterator objects...
> ---------------------------------------------------------------------
>
>                 Key: HBASE-12023
>                 URL: https://issues.apache.org/jira/browse/HBASE-12023
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.5, 0.94.23
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>            Priority: Minor
>             Fix For: 0.94.24
>
>         Attachments: HBASE-12023-0.94.patch, HBASE-12023.patch, 
> applyFamilyMapToMemstore (1).tiff
>
>
> for ... loop (creates iterator) inside another for loop. Produces a lot of 
> garbage. See attached picture.



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

Reply via email to