Class StatsMetadata

java.lang.Object
org.apache.cassandra.io.sstable.metadata.MetadataComponent
org.apache.cassandra.io.sstable.metadata.StatsMetadata
All Implemented Interfaces:
Comparable<MetadataComponent>

public class StatsMetadata extends MetadataComponent
SSTable metadata that always stay on heap.
  • Field Details

    • 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 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 ByteBuffer firstKey
    • lastKey

      public final ByteBuffer lastKey
  • Constructor Details

    • 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, List<AbstractType<?>> clusteringTypes, Slice coveredClustering, boolean hasLegacyCounterShards, long repairedAt, long totalColumnsSet, long totalRows, double tokenSpaceCoverage, UUID originatingHostId, TimeUUID pendingRepair, boolean isTransient, boolean hasPartitionLevelDeletions, ByteBuffer firstKey, ByteBuffer lastKey)
  • Method Details

    • getType

      public MetadataType getType()
      Specified by:
      getType in class MetadataComponent
      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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object