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

Ted Yu commented on HBASE-11550:
--------------------------------

Using Nick's sample change above, first item is 64 * 1024 + 1024.
In BucketAllocator#roundUpToBucketSizeInfo() :
{code}
    for (int i = 0; i < bucketSizes.length; ++i)
      if (blockSize <= bucketSizes[i])
        return bucketSizeInfos[i];
{code}
If we search for a bucket which is supposed to fit 32 * 1024 + 1024, the bucket 
for 64 * 1024 + 1024 would be returned. This would result in wasted storage.
{code}
+    Collections.sort(this.bucketSizes, Collections.reverseOrder());
{code}
Order should not be reversed.

> Bucket sizes passed through BUCKET_CACHE_BUCKETS_KEY should be validated
> ------------------------------------------------------------------------
>
>                 Key: HBASE-11550
>                 URL: https://issues.apache.org/jira/browse/HBASE-11550
>             Project: HBase
>          Issue Type: Task
>            Reporter: Ted Yu
>            Assignee: Gustavo Anatoly
>            Priority: Trivial
>         Attachments: HBASE-11550-v1.patch, HBASE-11550.patch
>
>
> User can pass bucket sizes through "hbase.bucketcache.bucket.sizes" config 
> entry.
> The sizes are supposed to be in increasing order. Validation should be added 
> in CacheConfig#getL2().



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to