You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org> on 2012/04/02 20:51:24 UTC

[jira] [Updated] (CASSANDRA-3966) KeyCacheKey and RowCacheKey to use raw byte[]

     [ https://issues.apache.org/jira/browse/CASSANDRA-3966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3966:
--------------------------------------

    Affects Version/s:     (was: 1.0.8)
                       1.0.0
        Fix Version/s:     (was: 1.0.10)
                       1.1.1

bq. Wondering if it will make sense to do use FreeableMemory instead of ByteBuffer if (SerializingCache is chosen) just for RowCacheKey

I don't think that would work -- the reason we can use FM for SC is that when we call cache.get, we deserialize and thus don't need to worry about reference counts anymore.  I don't think it's feasible to try to keep track of the referents of the key.  (Consider, for instance, a thread looping over the cache entries to save it.  Meanwhile, a cache entry gets evicted and we free it.  The saving thread will now happily segfault.)
                
> KeyCacheKey and RowCacheKey to use raw byte[]
> ---------------------------------------------
>
>                 Key: CASSANDRA-3966
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3966
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> We can just store the raw byte[] instead of byteBuffer,
> After reading the mail
> http://www.mail-archive.com/dev@cassandra.apache.org/msg03725.html
> Each ByteBuffer takes 48 bytes => for house keeping can be removed by just implementing hashcode and equals in the KeyCacheKey and RowCacheKey
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/nio/ByteBuffer.java#ByteBuffer.hashCode%28%29

--
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