Package org.apache.cassandra.db.rows
Class BufferCell
- java.lang.Object
-
- org.apache.cassandra.db.rows.ColumnData
-
- org.apache.cassandra.db.rows.Cell<V>
-
- org.apache.cassandra.db.rows.AbstractCell<java.nio.ByteBuffer>
-
- org.apache.cassandra.db.rows.BufferCell
-
- All Implemented Interfaces:
IMeasurableMemory
public class BufferCell extends AbstractCell<java.nio.ByteBuffer>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.rows.Cell
Cell.Factory<V>
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.rows.ColumnData
ColumnData.PostReconciliationFunction, ColumnData.Reconciler
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.db.rows.Cell
comparator, INVALID_DELETION_TIME, MAX_DELETION_TIME, MAX_DELETION_TIME_2038_LEGACY_CAP, MAX_DELETION_TIME_UNSIGNED_INTEGER, NO_DELETION_TIME, NO_DELETION_TIME_UNSIGNED_INTEGER, NO_TTL, serializer
-
Fields inherited from class org.apache.cassandra.db.rows.ColumnData
column, noOp
-
-
Constructor Summary
Constructors Constructor Description BufferCell(ColumnMetadata column, long timestamp, int ttl, int localDeletionTimeUnsignedInteger, java.nio.ByteBuffer value, CellPath path)
BufferCell(ColumnMetadata column, long timestamp, int ttl, long localDeletionTime, java.nio.ByteBuffer value, CellPath path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAccessor<java.nio.ByteBuffer>
accessor()
Cell<?>
clone(ByteBufferCloner cloner)
static BufferCell
expiring(ColumnMetadata column, long timestamp, int ttl, long nowInSec, java.nio.ByteBuffer value)
static BufferCell
expiring(ColumnMetadata column, long timestamp, int ttl, long nowInSec, java.nio.ByteBuffer value, CellPath path)
static BufferCell
live(ColumnMetadata column, long timestamp, java.nio.ByteBuffer value)
static BufferCell
live(ColumnMetadata column, long timestamp, java.nio.ByteBuffer value, CellPath path)
protected int
localDeletionTimeAsUnsignedInt()
CellPath
path()
For cells belonging to complex types (non-frozen collection and UDT), the path to the cell.long
timestamp()
The cell timestamp.static BufferCell
tombstone(ColumnMetadata column, long timestamp, long nowInSec)
static BufferCell
tombstone(ColumnMetadata column, long timestamp, long nowInSec, CellPath path)
int
ttl()
The cell ttl.long
unsharedHeapSize()
long
unsharedHeapSizeExcludingData()
java.nio.ByteBuffer
value()
Cell<?>
withSkippedValue()
Used to apply the same optimization as inCell.Serializer.deserialize(org.apache.cassandra.io.util.DataInputPlus, org.apache.cassandra.db.LivenessInfo, org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.SerializationHeader, org.apache.cassandra.db.rows.DeserializationHelper, org.apache.cassandra.db.marshal.ValueAccessor<V>)
when the column is not queried but eventhough it's used for digest calculation.Cell<?>
withUpdatedColumn(ColumnMetadata newColumn)
Cell<?>
withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, long newLocalDeletionTime)
Cell<?>
withUpdatedValue(java.nio.ByteBuffer newValue)
-
Methods inherited from class org.apache.cassandra.db.rows.AbstractCell
dataSize, digest, equals, equals, hashCode, hasInvalidDeletions, isCounterCell, isExpiring, isLive, isTombstone, markCounterLocalToBeCleared, maxTimestamp, purge, purgeDataOlderThan, toString, updateAllTimestamp, validate
-
Methods inherited from class org.apache.cassandra.db.rows.Cell
buffer, clone, decodeLocalDeletionTime, deletionTimeLongToUnsignedInteger, deletionTimeUnsignedIntegerToLong, getVersionedMaxDeletiontionTime, localDeletionTime, valueSize
-
Methods inherited from class org.apache.cassandra.db.rows.ColumnData
column, digest, reconciler
-
-
-
-
Constructor Detail
-
BufferCell
public BufferCell(ColumnMetadata column, long timestamp, int ttl, long localDeletionTime, java.nio.ByteBuffer value, CellPath path)
-
BufferCell
public BufferCell(ColumnMetadata column, long timestamp, int ttl, int localDeletionTimeUnsignedInteger, java.nio.ByteBuffer value, CellPath path)
-
-
Method Detail
-
live
public static BufferCell live(ColumnMetadata column, long timestamp, java.nio.ByteBuffer value)
-
live
public static BufferCell live(ColumnMetadata column, long timestamp, java.nio.ByteBuffer value, CellPath path)
-
expiring
public static BufferCell expiring(ColumnMetadata column, long timestamp, int ttl, long nowInSec, java.nio.ByteBuffer value)
-
expiring
public static BufferCell expiring(ColumnMetadata column, long timestamp, int ttl, long nowInSec, java.nio.ByteBuffer value, CellPath path)
-
tombstone
public static BufferCell tombstone(ColumnMetadata column, long timestamp, long nowInSec)
-
tombstone
public static BufferCell tombstone(ColumnMetadata column, long timestamp, long nowInSec, CellPath path)
-
timestamp
public long timestamp()
Description copied from class:Cell
The cell timestamp.
-
ttl
public int ttl()
Description copied from class:Cell
The cell ttl.
-
accessor
public ValueAccessor<java.nio.ByteBuffer> accessor()
-
path
public CellPath path()
Description copied from class:Cell
For cells belonging to complex types (non-frozen collection and UDT), the path to the cell.
-
withUpdatedColumn
public Cell<?> withUpdatedColumn(ColumnMetadata newColumn)
- Specified by:
withUpdatedColumn
in classCell<java.nio.ByteBuffer>
-
withUpdatedValue
public Cell<?> withUpdatedValue(java.nio.ByteBuffer newValue)
- Specified by:
withUpdatedValue
in classCell<java.nio.ByteBuffer>
-
withUpdatedTimestampAndLocalDeletionTime
public Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, long newLocalDeletionTime)
- Specified by:
withUpdatedTimestampAndLocalDeletionTime
in classCell<java.nio.ByteBuffer>
-
withSkippedValue
public Cell<?> withSkippedValue()
Description copied from class:Cell
Used to apply the same optimization as inCell.Serializer.deserialize(org.apache.cassandra.io.util.DataInputPlus, org.apache.cassandra.db.LivenessInfo, org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.SerializationHeader, org.apache.cassandra.db.rows.DeserializationHelper, org.apache.cassandra.db.marshal.ValueAccessor<V>)
when the column is not queried but eventhough it's used for digest calculation.- Specified by:
withSkippedValue
in classCell<java.nio.ByteBuffer>
- Returns:
- a cell with an empty buffer as value
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSize
in interfaceIMeasurableMemory
- Specified by:
unsharedHeapSize
in classColumnData
- 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.
-
clone
public Cell<?> clone(ByteBufferCloner cloner)
- Overrides:
clone
in classAbstractCell<java.nio.ByteBuffer>
-
unsharedHeapSizeExcludingData
public long unsharedHeapSizeExcludingData()
- Specified by:
unsharedHeapSizeExcludingData
in classColumnData
-
localDeletionTimeAsUnsignedInt
protected int localDeletionTimeAsUnsignedInt()
- Specified by:
localDeletionTimeAsUnsignedInt
in classCell<java.nio.ByteBuffer>
-
-