hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19684) BlockCacheKey toString Performance
Date Mon, 08 Jan 2018 13:47:00 GMT

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

Hudson commented on HBASE-19684:
--------------------------------

FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4363 (See [https://builds.apache.org/job/HBase-Trunk_matrix/4363/])
HBASE-19684 BlockCacheKey toString Performance (zhangduo: rev afc2cdbaffca6cb1f8495451a0b0940ad1fc4be0)
* (edit) hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java


> BlockCacheKey toString Performance
> ----------------------------------
>
>                 Key: HBASE-19684
>                 URL: https://issues.apache.org/jira/browse/HBASE-19684
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbase
>    Affects Versions: 3.0.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Trivial
>             Fix For: 3.0.0, 1.3.2, 1.4.1, 1.5.0, 1.2.7, 2.0.0-beta-2
>
>         Attachments: HBASE-19684.1.patch, HBASE-19684.2.patch
>
>
> {code:titile=BlockCacheKey.java}
>   @Override
>   public String toString() {
>     return String.format("%s_%d", hfileName, offset);
>   }
> {code}
> I found through bench-marking that the following code is 10x faster.
> {code:titi\le=BlockCacheKey.java}
>   @Override
>   public String toString() {
>     return hfileName.concat("_").concat(Long.toString(offset));
>   }
> {code}
> Normally it wouldn't matter for a _toString()_ method, but this is comes into play because
{{MemcachedBlockCache}} uses it.
> {code:title=MemcachedBlockCache.java}
>   @Override
>   public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf) {
>     if (buf instanceof HFileBlock) {
>       client.add(cacheKey.toString(), MAX_SIZE, (HFileBlock) buf, tc);
>     } else {
>       if (LOG.isDebugEnabled()) {
>         LOG.debug("MemcachedBlockCache can not cache Cacheable's of type "
>             + buf.getClass().toString());
>       }
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message