You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Enis Soztutar (JIRA)" <ji...@apache.org> on 2012/12/18 01:52:13 UTC

[jira] [Commented] (HBASE-7371) Blocksize in TestHFileBlock is unintentionally small

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

Enis Soztutar commented on HBASE-7371:
--------------------------------------

+1 on the change. 
                
> Blocksize in TestHFileBlock is unintentionally small
> ----------------------------------------------------
>
>                 Key: HBASE-7371
>                 URL: https://issues.apache.org/jira/browse/HBASE-7371
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Lars Hofhansl
>            Priority: Minor
>
> Looking at TestHFileBlock.writeBlocks I see this:
> {code}
>       for (int j = 0; j < rand.nextInt(500); ++j) {
>         // This might compress well.
>         dos.writeShort(i + 1);
>         dos.writeInt(j + 1);
>       }
> {code}
> The result is probably not what the author intended. {{rand.nextInt(500)}} is evaluated during each iterations and that leads to very small blocks size mostly between ~100 and 300 bytes or so.
> The author probably intended this:
> {code}
>       int size = rand.nextInt(500);
>       for (int j = 0; j < size; ++j) {
>         // This might compress well.
>         dos.writeShort(i + 1);
>         dos.writeInt(j + 1);
>       }
> {code}
> This leads to more reasonable block sizes between ~200 and 3000 bytes

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira