Class MetadataCollector
- java.lang.Object
-
- org.apache.cassandra.io.sstable.metadata.MetadataCollector
-
- All Implemented Interfaces:
PartitionStatisticsCollector
public class MetadataCollector extends java.lang.Object implements PartitionStatisticsCollector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetadataCollector.MinMaxIntTracker
static class
MetadataCollector.MinMaxLongTracker
-
Field Summary
Fields Modifier and Type Field Description protected com.clearspring.analytics.stream.cardinality.ICardinality
cardinality
Default cardinality estimation method is to use HyperLogLog++.protected IntervalSet<CommitLogPosition>
commitLogIntervals
protected double
compressionRatio
protected EstimatedHistogram
estimatedCellPerPartitionCount
protected EstimatedHistogram
estimatedPartitionSize
protected StreamingTombstoneHistogramBuilder
estimatedTombstoneDropTime
protected boolean
hasLegacyCounterShards
protected MetadataCollector.MinMaxLongTracker
localDeletionTimeTracker
static double
NO_COMPRESSION_RATIO
protected int
sstableLevel
protected MetadataCollector.MinMaxLongTracker
timestampTracker
protected double
tokenSpaceCoverage
protected long
totalColumnsSet
protected long
totalRows
int
totalTombstones
protected MetadataCollector.MinMaxIntTracker
ttlTracker
-
Constructor Summary
Constructors Constructor Description MetadataCollector(java.lang.Iterable<SSTableReader> sstables, ClusteringComparator comparator)
MetadataCollector(ClusteringComparator comparator)
MetadataCollector(ClusteringComparator comparator, java.util.UUID originatingHostId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataCollector
addCellPerPartitionCount()
MetadataCollector
addCellPerPartitionCount(long cellCount)
MetadataCollector
addCompressionRatio(long compressed, long uncompressed)
Ratio is compressed/uncompressed and it is if you have 1.x then compression isn't helpingMetadataCollector
addKey(java.nio.ByteBuffer key)
MetadataCollector
addPartitionSizeInBytes(long partitionSize)
MetadataCollector
commitLogIntervals(IntervalSet<CommitLogPosition> commitLogIntervals)
static StatsMetadata
defaultStatsMetadata()
java.util.Map<MetadataType,MetadataComponent>
finalizeMetadata(java.lang.String partitioner, double bloomFilterFPChance, long repairedAt, TimeUUID pendingRepair, boolean isTransient, SerializationHeader header, java.nio.ByteBuffer firstKey, java.nio.ByteBuffer lastKey)
void
release()
Release large memory objects while keeping metrics intactMetadataCollector
sstableLevel(int sstableLevel)
MetadataCollector
tokenSpaceCoverage(double coverage)
void
update(DeletionTime dt)
void
update(LivenessInfo newInfo)
void
update(Cell<?> cell)
void
updateClusteringValues(Clustering<?> clustering)
void
updateClusteringValuesByBoundOrBoundary(ClusteringBoundOrBoundary<?> clusteringBoundOrBoundary)
void
updateColumnSetPerRow(long columnSetInRow)
void
updateHasLegacyCounterShards(boolean hasLegacyCounterShards)
void
updatePartitionDeletion(DeletionTime dt)
-
-
-
Field Detail
-
NO_COMPRESSION_RATIO
public static final double NO_COMPRESSION_RATIO
- See Also:
- Constant Field Values
-
estimatedPartitionSize
protected EstimatedHistogram estimatedPartitionSize
-
estimatedCellPerPartitionCount
protected EstimatedHistogram estimatedCellPerPartitionCount
-
commitLogIntervals
protected IntervalSet<CommitLogPosition> commitLogIntervals
-
timestampTracker
protected final MetadataCollector.MinMaxLongTracker timestampTracker
-
localDeletionTimeTracker
protected final MetadataCollector.MinMaxLongTracker localDeletionTimeTracker
-
ttlTracker
protected final MetadataCollector.MinMaxIntTracker ttlTracker
-
compressionRatio
protected double compressionRatio
-
estimatedTombstoneDropTime
protected StreamingTombstoneHistogramBuilder estimatedTombstoneDropTime
-
sstableLevel
protected int sstableLevel
-
hasLegacyCounterShards
protected boolean hasLegacyCounterShards
-
totalColumnsSet
protected long totalColumnsSet
-
totalRows
protected long totalRows
-
totalTombstones
public int totalTombstones
-
tokenSpaceCoverage
protected double tokenSpaceCoverage
-
cardinality
protected com.clearspring.analytics.stream.cardinality.ICardinality cardinality
Default cardinality estimation method is to use HyperLogLog++. Parameter here(p=13, sp=25) should give reasonable estimation while lowering bytes required to hold information. See CASSANDRA-5906 for detail.
-
-
Constructor Detail
-
MetadataCollector
public MetadataCollector(ClusteringComparator comparator)
-
MetadataCollector
public MetadataCollector(ClusteringComparator comparator, java.util.UUID originatingHostId)
-
MetadataCollector
public MetadataCollector(java.lang.Iterable<SSTableReader> sstables, ClusteringComparator comparator)
-
-
Method Detail
-
defaultStatsMetadata
public static StatsMetadata defaultStatsMetadata()
-
addKey
public MetadataCollector addKey(java.nio.ByteBuffer key)
-
addPartitionSizeInBytes
public MetadataCollector addPartitionSizeInBytes(long partitionSize)
-
addCellPerPartitionCount
public MetadataCollector addCellPerPartitionCount(long cellCount)
-
addCellPerPartitionCount
public MetadataCollector addCellPerPartitionCount()
-
addCompressionRatio
public MetadataCollector addCompressionRatio(long compressed, long uncompressed)
Ratio is compressed/uncompressed and it is if you have 1.x then compression isn't helping
-
update
public void update(LivenessInfo newInfo)
- Specified by:
update
in interfacePartitionStatisticsCollector
-
update
public void update(Cell<?> cell)
- Specified by:
update
in interfacePartitionStatisticsCollector
-
updatePartitionDeletion
public void updatePartitionDeletion(DeletionTime dt)
- Specified by:
updatePartitionDeletion
in interfacePartitionStatisticsCollector
-
update
public void update(DeletionTime dt)
- Specified by:
update
in interfacePartitionStatisticsCollector
-
updateColumnSetPerRow
public void updateColumnSetPerRow(long columnSetInRow)
- Specified by:
updateColumnSetPerRow
in interfacePartitionStatisticsCollector
-
commitLogIntervals
public MetadataCollector commitLogIntervals(IntervalSet<CommitLogPosition> commitLogIntervals)
-
sstableLevel
public MetadataCollector sstableLevel(int sstableLevel)
-
tokenSpaceCoverage
public MetadataCollector tokenSpaceCoverage(double coverage)
-
updateClusteringValues
public void updateClusteringValues(Clustering<?> clustering)
-
updateClusteringValuesByBoundOrBoundary
public void updateClusteringValuesByBoundOrBoundary(ClusteringBoundOrBoundary<?> clusteringBoundOrBoundary)
-
updateHasLegacyCounterShards
public void updateHasLegacyCounterShards(boolean hasLegacyCounterShards)
- Specified by:
updateHasLegacyCounterShards
in interfacePartitionStatisticsCollector
-
finalizeMetadata
public java.util.Map<MetadataType,MetadataComponent> finalizeMetadata(java.lang.String partitioner, double bloomFilterFPChance, long repairedAt, TimeUUID pendingRepair, boolean isTransient, SerializationHeader header, java.nio.ByteBuffer firstKey, java.nio.ByteBuffer lastKey)
-
release
public void release()
Release large memory objects while keeping metrics intact
-
-