Package org.apache.cassandra.cache
Class CounterCacheKey
- java.lang.Object
-
- org.apache.cassandra.cache.CacheKey
-
- org.apache.cassandra.cache.CounterCacheKey
-
- All Implemented Interfaces:
IMeasurableMemory
public final class CounterCacheKey extends CacheKey
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CounterCacheKeycreate(TableMetadata tableMetadata, java.nio.ByteBuffer partitionKey, Clustering<?> clustering, ColumnMetadata c, CellPath path)booleanequals(java.lang.Object o)inthashCode()java.nio.ByteBufferpartitionKey()static CounterCacheKeyread(TableMetadata tableMetadata, DataInputPlus in)java.nio.ByteBufferreadCounterValue(ColumnFamilyStore cfs)Reads the value of the counter represented by this key.java.lang.StringtoString()longunsharedHeapSize()voidwrite(DataOutputPlus out)
-
-
-
Method Detail
-
create
public static CounterCacheKey create(TableMetadata tableMetadata, java.nio.ByteBuffer partitionKey, Clustering<?> clustering, ColumnMetadata c, CellPath path)
-
partitionKey
public java.nio.ByteBuffer partitionKey()
-
readCounterValue
public java.nio.ByteBuffer readCounterValue(ColumnFamilyStore cfs)
Reads the value of the counter represented by this key.- Parameters:
cfs- the store for the table this is a key of.- Returns:
- the value for the counter represented by this key, or
nullif there is not such counter.
-
write
public void write(DataOutputPlus out) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static CounterCacheKey read(TableMetadata tableMetadata, DataInputPlus in) throws java.io.IOException
- Throws:
java.io.IOException
-
unsharedHeapSize
public long unsharedHeapSize()
- 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
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-