Class StatsMetadata
- java.lang.Object
-
- org.apache.cassandra.io.sstable.metadata.MetadataComponent
-
- org.apache.cassandra.io.sstable.metadata.StatsMetadata
-
- All Implemented Interfaces:
java.lang.Comparable<MetadataComponent>
public class StatsMetadata extends MetadataComponent
SSTable metadata that always stay on heap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StatsMetadata.StatsMetadataSerializer
-
Field Summary
Fields Modifier and Type Field Description IntervalSet<CommitLogPosition>
commitLogIntervals
static ISerializer<IntervalSet<CommitLogPosition>>
commitLogPositionSetSerializer
double
compressionRatio
Slice
coveredClustering
EncodingStats
encodingStats
EstimatedHistogram
estimatedCellPerPartitionCount
EstimatedHistogram
estimatedPartitionSize
TombstoneHistogram
estimatedTombstoneDropTime
java.nio.ByteBuffer
firstKey
boolean
hasLegacyCounterShards
boolean
hasPartitionLevelDeletions
This boolean is used as an approximation of whether a given key can be guaranteed not to have partition deletions in this sstable.boolean
isTransient
java.nio.ByteBuffer
lastKey
long
maxLocalDeletionTime
long
maxTimestamp
int
maxTTL
long
minLocalDeletionTime
long
minTimestamp
int
minTTL
java.util.UUID
originatingHostId
TimeUUID
pendingRepair
long
repairedAt
static IMetadataComponentSerializer
serializer
int
sstableLevel
double
tokenSpaceCoverage
long
totalColumnsSet
long
totalRows
-
Constructor Summary
Constructors Constructor Description StatsMetadata(EstimatedHistogram estimatedPartitionSize, EstimatedHistogram estimatedCellPerPartitionCount, IntervalSet<CommitLogPosition> commitLogIntervals, long minTimestamp, long maxTimestamp, long minLocalDeletionTime, long maxLocalDeletionTime, int minTTL, int maxTTL, double compressionRatio, TombstoneHistogram estimatedTombstoneDropTime, int sstableLevel, java.util.List<AbstractType<?>> clusteringTypes, Slice coveredClustering, boolean hasLegacyCounterShards, long repairedAt, long totalColumnsSet, long totalRows, double tokenSpaceCoverage, java.util.UUID originatingHostId, TimeUUID pendingRepair, boolean isTransient, boolean hasPartitionLevelDeletions, java.nio.ByteBuffer firstKey, java.nio.ByteBuffer lastKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
double
getDroppableTombstonesBefore(long gcBefore)
double
getEstimatedDroppableTombstoneRatio(long gcBefore)
MetadataType
getType()
int
hashCode()
StatsMetadata
mutateLevel(int newLevel)
StatsMetadata
mutateRepairedMetadata(long newRepairedAt, TimeUUID newPendingRepair, boolean newIsTransient)
-
Methods inherited from class org.apache.cassandra.io.sstable.metadata.MetadataComponent
compareTo
-
-
-
-
Field Detail
-
serializer
public static final IMetadataComponentSerializer serializer
-
commitLogPositionSetSerializer
public static final ISerializer<IntervalSet<CommitLogPosition>> commitLogPositionSetSerializer
-
estimatedPartitionSize
public final EstimatedHistogram estimatedPartitionSize
-
estimatedCellPerPartitionCount
public final EstimatedHistogram estimatedCellPerPartitionCount
-
commitLogIntervals
public final IntervalSet<CommitLogPosition> commitLogIntervals
-
minTimestamp
public final long minTimestamp
-
maxTimestamp
public final long maxTimestamp
-
minLocalDeletionTime
public final long minLocalDeletionTime
-
maxLocalDeletionTime
public final long maxLocalDeletionTime
-
minTTL
public final int minTTL
-
maxTTL
public final int maxTTL
-
compressionRatio
public final double compressionRatio
-
estimatedTombstoneDropTime
public final TombstoneHistogram estimatedTombstoneDropTime
-
sstableLevel
public final int sstableLevel
-
coveredClustering
public final Slice coveredClustering
-
hasLegacyCounterShards
public final boolean hasLegacyCounterShards
-
tokenSpaceCoverage
public final double tokenSpaceCoverage
-
repairedAt
public final long repairedAt
-
totalColumnsSet
public final long totalColumnsSet
-
totalRows
public final long totalRows
-
originatingHostId
public final java.util.UUID originatingHostId
-
pendingRepair
public final TimeUUID pendingRepair
-
isTransient
public final boolean isTransient
-
encodingStats
public final EncodingStats encodingStats
-
hasPartitionLevelDeletions
public final boolean hasPartitionLevelDeletions
This boolean is used as an approximation of whether a given key can be guaranteed not to have partition deletions in this sstable. Obviously, this is pretty imprecise: a single partition deletion in the sstable means we have to assume _any_ key may have a partition deletion. This is still likely useful as workloads that does not use partition level deletions, or only very rarely, are probably not that rare. TODO we could replace this by a small bloom-filter instead; the only downside being that we'd have to care about the size of this bloom filters not getting out of hands, and it's a tiny bit unclear if it's worth the added complexity.
-
firstKey
public final java.nio.ByteBuffer firstKey
-
lastKey
public final java.nio.ByteBuffer lastKey
-
-
Constructor Detail
-
StatsMetadata
public StatsMetadata(EstimatedHistogram estimatedPartitionSize, EstimatedHistogram estimatedCellPerPartitionCount, IntervalSet<CommitLogPosition> commitLogIntervals, long minTimestamp, long maxTimestamp, long minLocalDeletionTime, long maxLocalDeletionTime, int minTTL, int maxTTL, double compressionRatio, TombstoneHistogram estimatedTombstoneDropTime, int sstableLevel, java.util.List<AbstractType<?>> clusteringTypes, Slice coveredClustering, boolean hasLegacyCounterShards, long repairedAt, long totalColumnsSet, long totalRows, double tokenSpaceCoverage, java.util.UUID originatingHostId, TimeUUID pendingRepair, boolean isTransient, boolean hasPartitionLevelDeletions, java.nio.ByteBuffer firstKey, java.nio.ByteBuffer lastKey)
-
-
Method Detail
-
getType
public MetadataType getType()
- Specified by:
getType
in classMetadataComponent
- Returns:
- Metadata component type
-
getEstimatedDroppableTombstoneRatio
public double getEstimatedDroppableTombstoneRatio(long gcBefore)
- Parameters:
gcBefore
- gc time in seconds- Returns:
- estimated droppable tombstone ratio at given gcBefore time.
-
getDroppableTombstonesBefore
public double getDroppableTombstonesBefore(long gcBefore)
- Parameters:
gcBefore
- gc time in seconds- Returns:
- amount of droppable tombstones
-
mutateLevel
public StatsMetadata mutateLevel(int newLevel)
-
mutateRepairedMetadata
public StatsMetadata mutateRepairedMetadata(long newRepairedAt, TimeUUID newPendingRepair, boolean newIsTransient)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-