org.apache.cassandra.db.compaction

## Class LeveledManifest

- java.lang.Object
- - org.apache.cassandra.db.compaction.LeveledManifest

    public class LeveledManifest
    extends java.lang.Object

### Nested Class Summary

Nested Classes
`static class` `LeveledManifest.CompactionCandidate`

### Field Summary

Fields
`protected java.util.List<SSTableReader>[]` `generations`
`static int` `MAX_LEVEL_COUNT`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `add(SSTableReader reader)`
`void` `calculateLastCompactedKeys()` If we want to start compaction in level n, find the newest (by modification time) file in level n+1 and use its last token for last compacted key in level n;
`static LeveledManifest` `create(ColumnFamilyStore cfs, int maxSSTableSize, int fanoutSize, java.lang.Iterable<SSTableReader> sstables, SizeTieredCompactionStrategyOptions options)`
`static LeveledManifest` `create(ColumnFamilyStore cfs, int maxSSTableSize, int fanoutSize, java.util.List<SSTableReader> sstables)`
`int[]` `getAllLevelSize()`
`java.lang.Iterable<SSTableReader>` `getAllSSTables()`
`LeveledManifest.CompactionCandidate` `getCompactionCandidates()`
`int` `getEstimatedTasks()`
`java.util.List<SSTableReader>` `getLevel(int i)`
`int` `getLevelCount()`
`int` `getLevelSize(int i)`
`java.util.SortedSet<SSTableReader>` `getLevelSorted(int level, java.util.Comparator<SSTableReader> comparator)`
`int` `getNextLevel(java.util.Collection<SSTableReader> sstables)`
`java.util.Set<SSTableReader>[]` `getSStablesPerLevelSnapshot()`
`static long` `maxBytesForLevel(int level, int levelFanoutSize, long maxSSTableSizeInBytes)`
`long` `maxBytesForLevel(int level, long maxSSTableSizeInBytes)`
`int` `remove(SSTableReader reader)`
`void` `repairOverlappingSSTables(int level)`
`void` `replace(java.util.Collection<SSTableReader> removed, java.util.Collection<SSTableReader> added)`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### MAX_LEVEL_COUNT

    public static final int MAX_LEVEL_COUNT

#### generations

    protected final java.util.List<SSTableReader>[] generations

### Method Detail

#### create

    public static LeveledManifest create(ColumnFamilyStore cfs,
                                         int maxSSTableSize,
                                         int fanoutSize,
                                         java.util.List<SSTableReader> sstables)

#### create

    public static LeveledManifest create(ColumnFamilyStore cfs,
                                         int maxSSTableSize,
                                         int fanoutSize,
                                         java.lang.Iterable<SSTableReader> sstables,
                                         SizeTieredCompactionStrategyOptions options)

#### calculateLastCompactedKeys

    public void calculateLastCompactedKeys()

If we want to start compaction in level n, find the newest (by modification time) file in level n+1 and use its last token for last compacted key in level n;

#### add

    public void add(SSTableReader reader)

#### replace

    public void replace(java.util.Collection<SSTableReader> removed,
                        java.util.Collection<SSTableReader> added)

#### repairOverlappingSSTables

    public void repairOverlappingSSTables(int level)

#### maxBytesForLevel

    public long maxBytesForLevel(int level,
                                 long maxSSTableSizeInBytes)

#### maxBytesForLevel

    public static long maxBytesForLevel(int level,
                                        int levelFanoutSize,
                                        long maxSSTableSizeInBytes)

#### getCompactionCandidates

    public LeveledManifest.CompactionCandidate getCompactionCandidates()

Returns:
  highest-priority sstables to compact, and level to compact them to If no compactions are necessary, will return null

#### getLevelSize

    public int getLevelSize(int i)

#### getAllLevelSize

    public int[] getAllLevelSize()

#### remove

    public int remove(SSTableReader reader)

#### getSStablesPerLevelSnapshot

    public java.util.Set<SSTableReader>[] getSStablesPerLevelSnapshot()

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### getLevelCount

    public int getLevelCount()

#### getLevelSorted

    public java.util.SortedSet<SSTableReader> getLevelSorted(int level,
                                                             java.util.Comparator<SSTableReader> comparator)

#### getLevel

    public java.util.List<SSTableReader> getLevel(int i)

#### getEstimatedTasks

    public int getEstimatedTasks()

#### getNextLevel

    public int getNextLevel(java.util.Collection<SSTableReader> sstables)

#### getAllSSTables

    public java.lang.Iterable<SSTableReader> getAllSSTables()