Package org.apache.cassandra.db.rows
Class NativeCell
- 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.NativeCell
-
- All Implemented Interfaces:
IMeasurableMemory
public class NativeCell 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, MAX_DELETION_TIME, NO_DELETION_TIME, NO_TTL, serializer
-
Fields inherited from class org.apache.cassandra.db.rows.ColumnData
column, noOp
-
-
Constructor Summary
Constructors Constructor Description NativeCell(NativeAllocator allocator, OpOrder.Group writeOp, Cell<?> cell)NativeCell(NativeAllocator allocator, OpOrder.Group writeOp, ColumnMetadata column, long timestamp, int ttl, int localDeletionTime, java.nio.ByteBuffer value, CellPath path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAccessor<java.nio.ByteBuffer>accessor()intlocalDeletionTime()The cell local deletion time.longoffHeapSize()CellPathpath()For cells belonging to complex types (non-frozen collection and UDT), the path to the cell.longtimestamp()The cell timestamp.intttl()The cell ttl.longunsharedHeapSize()longunsharedHeapSizeExcludingData()java.nio.ByteBuffervalue()CellwithSkippedValue()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 column)Cell<?>withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, int newLocalDeletionTime)Cell<?>withUpdatedValue(java.nio.ByteBuffer newValue)-
Methods inherited from class org.apache.cassandra.db.rows.AbstractCell
clone, 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.ColumnData
column, digest, reconciler
-
-
-
-
Constructor Detail
-
NativeCell
public NativeCell(NativeAllocator allocator, OpOrder.Group writeOp, Cell<?> cell)
-
NativeCell
public NativeCell(NativeAllocator allocator, OpOrder.Group writeOp, ColumnMetadata column, long timestamp, int ttl, int localDeletionTime, java.nio.ByteBuffer value, CellPath path)
-
-
Method Detail
-
timestamp
public long timestamp()
Description copied from class:CellThe cell timestamp.
-
ttl
public int ttl()
Description copied from class:CellThe cell ttl.
-
localDeletionTime
public int localDeletionTime()
Description copied from class:CellThe cell local deletion time.- Specified by:
localDeletionTimein classCell<java.nio.ByteBuffer>- Returns:
- the cell local deletion time, or
NO_DELETION_TIMEif the cell is neither a tombstone nor an expiring one.
-
accessor
public ValueAccessor<java.nio.ByteBuffer> accessor()
-
path
public CellPath path()
Description copied from class:CellFor cells belonging to complex types (non-frozen collection and UDT), the path to the cell.
-
withUpdatedValue
public Cell<?> withUpdatedValue(java.nio.ByteBuffer newValue)
- Specified by:
withUpdatedValuein classCell<java.nio.ByteBuffer>
-
withUpdatedTimestampAndLocalDeletionTime
public Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, int newLocalDeletionTime)
- Specified by:
withUpdatedTimestampAndLocalDeletionTimein classCell<java.nio.ByteBuffer>
-
withUpdatedColumn
public Cell<?> withUpdatedColumn(ColumnMetadata column)
- Specified by:
withUpdatedColumnin classCell<java.nio.ByteBuffer>
-
withSkippedValue
public Cell withSkippedValue()
Description copied from class:CellUsed 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:
withSkippedValuein classCell<java.nio.ByteBuffer>- Returns:
- a cell with an empty buffer as value
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSizein interfaceIMeasurableMemory- Specified by:
unsharedHeapSizein 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.
-
unsharedHeapSizeExcludingData
public long unsharedHeapSizeExcludingData()
- Specified by:
unsharedHeapSizeExcludingDatain classColumnData
-
offHeapSize
public long offHeapSize()
-
-