You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Todd Lipcon (Created) (JIRA)" <ji...@apache.org> on 2011/10/10 22:16:29 UTC

[jira] [Created] (HBASE-4569) Simpler implementation for slab cache

Simpler implementation for slab cache
-------------------------------------

                 Key: HBASE-4569
                 URL: https://issues.apache.org/jira/browse/HBASE-4569
             Project: HBase
          Issue Type: Improvement
          Components: regionserver
    Affects Versions: 0.92.0
            Reporter: Todd Lipcon
         Attachments: hbase-4569.txt

I spent a little bit of time last night hacking on the slab cache implementation to make it a little simpler. The change is:
- no longer has the composition of SlabCache containing a SingleSizeCache per slab size. SlabCache holds its own slabs
- no longer use guava's map implementations to handle a size-bounded cache. Instead, manages its own LRU linked list
- significantly less clever about synchronization. since this is an L2 cache, it should be less contended than the L1 cache, and I think we can afford to be dumb.
- should have less memory usage since there's only one map entry per key instead of several.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4569) Simpler implementation for slab cache

Posted by "Todd Lipcon (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HBASE-4569:
-------------------------------

    Attachment: hbase-4569.txt

here's a draft patch. doesn't pass the heapsize tests, and lacks some metrics stuff, but passes the actual cache tests.

Interested to see if people think this is the right direction.
                
> Simpler implementation for slab cache
> -------------------------------------
>
>                 Key: HBASE-4569
>                 URL: https://issues.apache.org/jira/browse/HBASE-4569
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>         Attachments: hbase-4569.txt
>
>
> I spent a little bit of time last night hacking on the slab cache implementation to make it a little simpler. The change is:
> - no longer has the composition of SlabCache containing a SingleSizeCache per slab size. SlabCache holds its own slabs
> - no longer use guava's map implementations to handle a size-bounded cache. Instead, manages its own LRU linked list
> - significantly less clever about synchronization. since this is an L2 cache, it should be less contended than the L1 cache, and I think we can afford to be dumb.
> - should have less memory usage since there's only one map entry per key instead of several.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4569) Simpler implementation for slab cache

Posted by "Ted Yu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124675#comment-13124675 ] 

Ted Yu commented on HBASE-4569:
-------------------------------

Overall, the logic is simpler.
Tests in TestSlabCache should be enabled.

In SlabCache.cacheBlock(), slabEntry.getKey() at line 216 can be removed.

I ran TestSlabCache several times and they passed.

Please upload to review board after fixing testHeapSizeChanges

Nice work Todd.
                
> Simpler implementation for slab cache
> -------------------------------------
>
>                 Key: HBASE-4569
>                 URL: https://issues.apache.org/jira/browse/HBASE-4569
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.92.0
>            Reporter: Todd Lipcon
>         Attachments: hbase-4569.txt
>
>
> I spent a little bit of time last night hacking on the slab cache implementation to make it a little simpler. The change is:
> - no longer has the composition of SlabCache containing a SingleSizeCache per slab size. SlabCache holds its own slabs
> - no longer use guava's map implementations to handle a size-bounded cache. Instead, manages its own LRU linked list
> - significantly less clever about synchronization. since this is an L2 cache, it should be less contended than the L1 cache, and I think we can afford to be dumb.
> - should have less memory usage since there's only one map entry per key instead of several.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira