Class EncodingStats
- java.lang.Object
-
- org.apache.cassandra.db.rows.EncodingStats
-
- All Implemented Interfaces:
IMeasurableMemory
public class EncodingStats extends java.lang.Object implements IMeasurableMemory
Stats used for the encoding of the rows and tombstones of a given source.Those stats are used to optimize the on-wire and on-disk storage of rows. More precisely, the
minTimestamp,minLocalDeletionTimeandminTTLstats are used to delta-encode those information for the sake of vint encoding.Note that due to their use, those stats can suffer to be somewhat inaccurate (the more incurrate they are, the less effective the storage will be, but provided the stats are not completly wacky, this shouldn't have too huge an impact on performance) and in fact they will not always be accurate for reasons explained in
SerializationHeader.make(org.apache.cassandra.schema.TableMetadata, java.util.Collection<org.apache.cassandra.io.sstable.format.SSTableReader>).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEncodingStats.Collectorstatic classEncodingStats.Serializer
-
Field Summary
Fields Modifier and Type Field Description static longHEAP_SIZEintminLocalDeletionTimelongminTimestampintminTTLstatic EncodingStatsNO_STATSstatic EncodingStats.Serializerserializerstatic longTIMESTAMP_EPOCH
-
Constructor Summary
Constructors Constructor Description EncodingStats(long minTimestamp, int minLocalDeletionTime, int minTTL)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()static <V,F extends java.util.function.Function<V,EncodingStats>>
EncodingStatsmerge(java.util.List<V> values, F function)Merge one or more EncodingStats, that are lazily materialized from some list of arbitrary type by the provided functionEncodingStatsmergeWith(EncodingStats that)Merge this stats with another one.java.lang.StringtoString()longunsharedHeapSize()
-
-
-
Field Detail
-
TIMESTAMP_EPOCH
public static final long TIMESTAMP_EPOCH
-
NO_STATS
public static final EncodingStats NO_STATS
-
HEAP_SIZE
public static long HEAP_SIZE
-
serializer
public static final EncodingStats.Serializer serializer
-
minTimestamp
public final long minTimestamp
-
minLocalDeletionTime
public final int minLocalDeletionTime
-
minTTL
public final int minTTL
-
-
Method Detail
-
mergeWith
public EncodingStats mergeWith(EncodingStats that)
Merge this stats with another one.The comments of
SerializationHeader.make(org.apache.cassandra.schema.TableMetadata, java.util.Collection<org.apache.cassandra.io.sstable.format.SSTableReader>)applies here too, i.e. the result of merging will be not totally accurate but we can live with that.
-
merge
public static <V,F extends java.util.function.Function<V,EncodingStats>> EncodingStats merge(java.util.List<V> values, F function)
Merge one or more EncodingStats, that are lazily materialized from some list of arbitrary type by the provided function
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSizein interfaceIMeasurableMemory- Returns:
- the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-