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 classMetadataCollector.MinMaxIntTrackerstatic classMetadataCollector.MinMaxLongTracker
-
Field Summary
Fields Modifier and Type Field Description protected com.clearspring.analytics.stream.cardinality.ICardinalitycardinalityDefault cardinality estimation method is to use HyperLogLog++.protected IntervalSet<CommitLogPosition>commitLogIntervalsprotected doublecompressionRatioprotected EstimatedHistogramestimatedCellPerPartitionCountprotected EstimatedHistogramestimatedPartitionSizeprotected StreamingTombstoneHistogramBuilderestimatedTombstoneDropTimeprotected booleanhasLegacyCounterShardsprotected MetadataCollector.MinMaxIntTrackerlocalDeletionTimeTrackerstatic doubleNO_COMPRESSION_RATIOprotected intsstableLevelprotected MetadataCollector.MinMaxLongTrackertimestampTrackerprotected longtotalColumnsSetprotected longtotalRowsinttotalTombstonesprotected MetadataCollector.MinMaxIntTrackerttlTracker
-
Constructor Summary
Constructors Constructor Description MetadataCollector(java.lang.Iterable<SSTableReader> sstables, ClusteringComparator comparator, int level)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 MetadataCollectoraddCellPerPartitionCount(long cellCount)MetadataCollectoraddCompressionRatio(long compressed, long uncompressed)Ratio is compressed/uncompressed and it is if you have 1.x then compression isn't helpingMetadataCollectoraddKey(java.nio.ByteBuffer key)MetadataCollectoraddPartitionSizeInBytes(long partitionSize)MetadataCollectorcommitLogIntervals(IntervalSet<CommitLogPosition> commitLogIntervals)static StatsMetadatadefaultStatsMetadata()java.util.Map<MetadataType,MetadataComponent>finalizeMetadata(java.lang.String partitioner, double bloomFilterFPChance, long repairedAt, TimeUUID pendingRepair, boolean isTransient, SerializationHeader header)voidrelease()Release large memory objects while keeping metrics intactMetadataCollectorsstableLevel(int sstableLevel)voidupdate(DeletionTime dt)voidupdate(LivenessInfo newInfo)voidupdate(Cell<?> cell)MetadataCollectorupdateClusteringValues(ClusteringPrefix<?> clustering)voidupdateColumnSetPerRow(long columnSetInRow)voidupdateHasLegacyCounterShards(boolean hasLegacyCounterShards)
-
-
-
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.MinMaxIntTracker 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
-
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, int level)
-
-
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)
-
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:
updatein interfacePartitionStatisticsCollector
-
update
public void update(Cell<?> cell)
- Specified by:
updatein interfacePartitionStatisticsCollector
-
update
public void update(DeletionTime dt)
- Specified by:
updatein interfacePartitionStatisticsCollector
-
updateColumnSetPerRow
public void updateColumnSetPerRow(long columnSetInRow)
- Specified by:
updateColumnSetPerRowin interfacePartitionStatisticsCollector
-
commitLogIntervals
public MetadataCollector commitLogIntervals(IntervalSet<CommitLogPosition> commitLogIntervals)
-
sstableLevel
public MetadataCollector sstableLevel(int sstableLevel)
-
updateClusteringValues
public MetadataCollector updateClusteringValues(ClusteringPrefix<?> clustering)
-
updateHasLegacyCounterShards
public void updateHasLegacyCounterShards(boolean hasLegacyCounterShards)
- Specified by:
updateHasLegacyCounterShardsin interfacePartitionStatisticsCollector
-
finalizeMetadata
public java.util.Map<MetadataType,MetadataComponent> finalizeMetadata(java.lang.String partitioner, double bloomFilterFPChance, long repairedAt, TimeUUID pendingRepair, boolean isTransient, SerializationHeader header)
-
release
public void release()
Release large memory objects while keeping metrics intact
-
-