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

Sylvain Lebresne commented on CASSANDRA-3143:
---------------------------------------------

bq. On the other hand, if we will be using descriptor -> id relationship, 
wouldn't it create the same amount of additional I/O (+ expenses on such cache 
maintain) as just having Descriptor as cache key?

I'm not talking of changing KeyCacheKey in any way. I'm talking of making the 
key cache save being 2 files (keySave and keySaveMetadata) having the key cache 
save method looking something like that (in pseudo-code):
{noformat}
Map<Descriptor, Integer> assoc = new HashMap();
int nextId = 0;
for (KeyCacheKey key : keys)
{
   Integer id = assoc.get(key.desc);
   if (id == null)
   {
      // descriptor we haven't seen yet during this save
      id = nextId++;
      assoc.put(key.desc, id);
      keySaveMetadata.write(key.desc => id)
   }
   keySave.write(id => key.key)
}
{noformat}
And the reading would first load the map from keySaveMetadata and read keySave.

bq. Sure, I will just change that to 40 bytes and update doc for 
key_cache_size_in_mb

I would be in favor of not documenting this in the yaml as it'll confuse more 
user than anything else and we don't want anyone to rely on that formula.
                
> Global caches (key/row)
> -----------------------
>
>                 Key: CASSANDRA-3143
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3143
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>              Labels: Core
>             Fix For: 1.1
>
>         Attachments: 0001-global-key-cache.patch, 
> 0002-global-row-cache-and-ASC.readSaved-changed-to-abstra.patch, 
> 0003-CacheServiceMBean-and-correct-key-cache-loading.patch, 
> 0004-key-row-cache-tests-and-tweaks.patch, 
> 0005-cleanup-of-the-CFMetaData-and-thrift-avro-CfDef-and-.patch, 
> 0006-row-key-cache-improvements-according-to-Sylvain-s-co.patch
>
>
> Caches are difficult to configure well as ColumnFamilies are added, similar 
> to how memtables were difficult pre-CASSANDRA-2006.

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

        

Reply via email to