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

Pavel Yaskevich commented on CASSANDRA-3762:
--------------------------------------------

We can't require caches drop from users if they want to update to the newer 
version, imagine if users had a big caches and they would expect them to be 
warmed up to serve traffic from the beginning (good user experience on system 
start-up). 

We should support current (old cached keys are saved) and new (key + position 
in the SSTable) schemas equally. Also I don't think that (de-)serializer logic, 
as you did it, is really needed because we would have sufficient data inside of 
the cache file to pre-load cache with one simple algorithm (in pseudo-code): 

For *KeyCache*:
{code}
while (!eof(cache_file)) {
   cache_entry = deserialize_entry(cache_file)

   # we don't want to load into the cache entry where 
   # SSTable to which descriptor corresponds does not exist (compacted, deleted)
   if (exists(cache_entry.key.descriptor))
      cache.put(cache_entry)
}
{code}

For *RowCache*:
{code}
while (!eof(cache_file)) {
   # as simple as data because we presume that we did cache save as part of the 
shutdown *(which we should do)*
   cache.put(deserialize_entry(cache_file))
}
{code}

It could be as simple as that because we know how to (de-)serialize 
RowIndexEntry (that KeyCache uses) as well as ColumnFamily (that RowCache 
uses), note that we would write/read and (de-)serialize both caches with 
sequential I/O.

                
> AutoSaving KeyCache and System load time improvements.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-3762
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3762
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.2
>            Reporter: Vijay
>            Assignee: Vijay
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: 0001-CASSANDRA-3762-v2.patch, 
> 0001-SavedKeyCache-load-time-improvements.patch
>
>
> CASSANDRA-2392 saves the index summary to the disk... but when we have saved 
> cache we will still scan through the index to get the data out.
> We might be able to separate this from SSTR.load and let it load the index 
> summary, once all the SST's are loaded we might be able to check the 
> bloomfilter and do a random IO on fewer Index's to populate the KeyCache.

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