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

Gustavo Anatoly commented on HBASE-11550:
-----------------------------------------

Gentlemen, thanks for review.

Hello, [~ndimiduk] about your question:
bq. Why switch to List everywhere?

We have the follow code:
{code}
public BucketSizeInfo roundUpToBucketSizeInfo(int blockSize) {
    for (int i = 0; i < bucketSizes.size(); ++i)
      if (blockSize <= bucketSizes.get(i))
        return bucketSizeInfos[i];
    return null;
  }
{code}

Thus, if we have a reversed bucketSizes it will search in the largest 
bucketSizes( i ) on the top of array first. This sounds obvious, but the 
intention is increase the probability to find the bucketSizeInfo in the largest 
bucketSizes first. It's a pretty simple optimization.

But how you suggest and [~stack] I can add some tests to verify the sort 
problem and other test to wastage.

Hello, [~tedyu] thanks for the comment, I will write some test to verify the 
condition mentioned by you.

Thanks, guys.

> 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