cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei Deng (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-3952) avoid quadratic startup time in LeveledManifest
Date Thu, 21 Jul 2016 07:18:20 GMT

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

Wei Deng updated CASSANDRA-3952:
--------------------------------
    Labels: lcs lhf  (was: lhf)

> avoid quadratic startup time in LeveledManifest
> -----------------------------------------------
>
>                 Key: CASSANDRA-3952
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3952
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jonathan Ellis
>            Assignee: Dave Brosius
>            Priority: Minor
>              Labels: lcs, lhf
>             Fix For: 1.1.0
>
>         Attachments: speed_up_level_of.diff
>
>
> Checking that each sstable is in the manifest on startup is O(N**2) in the number of
sstables:
> {code}
> .       // ensure all SSTables are in the manifest
>         for (SSTableReader ssTableReader : cfs.getSSTables())
>         {
>             if (manifest.levelOf(ssTableReader) < 0)
>                 manifest.add(ssTableReader);
>         }
> {code}
> {code}
> private int levelOf(SSTableReader sstable)
> {
>     for (int level = 0; level < generations.length; level++)
>     {
>         if (generations[level].contains(sstable))
>             return level;
>     }
>     return -1;
> }
> {code}
> Note that the contains call is a linear List.contains.
> We need to switch to a sorted list and bsearch, or a tree, to support TB-levels of data
in LeveledCompactionStrategy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message