public abstract class AbstractNativeCell extends AbstractCell implements CellName
Packs a CellName AND a Cell into one off-heap representation.
Layout is:
Note we store the ColumnIdentifier in full as bytes. This seems an okay tradeoff for now, as we just
look it back up again when we need to, and in the near future we hope to switch to ints, longs or
UUIDs representing column identifiers on disk, at which point we can switch that here as well.
[timestamp][value offset][name size]][name extra][name offset deltas][cell names][value][Descendants]
[ 8b ][ 4b ][ 2b ][ 1b ][ each 2b ][ arb < 64k][ arb ][ arbitrary ]
descendants: any overriding classes will put their state here
name offsets are deltas from their base offset, and don't include the first offset, or the end position of the final entry,
i.e. there will be size - 1 entries, and each is a delta that is added to the offset of the position of the first name
(which is always CELL_NAME_OFFSETS_OFFSET + (2 * (size - 1))). The length of the final name fills up any remaining
space upto the value offset
name extra: lowest 2 bits indicate the clustering size delta (i.e. how many name items are NOT part of the clustering key)
the next 2 bits indicate the CellNameType
the next bit indicates if the column is a static or clustered/dynamic column
Composite.EOCOnDiskAtom.Serializer, OnDiskAtom.SerializerForWritingMAX_NAME_LENGTH| Constructor and Description |
|---|
AbstractNativeCell(NativeAllocator allocator,
OpOrder.Group writeOp,
Cell copyOf) |
| Modifier and Type | Method and Description |
|---|---|
int |
clusteringSize()
The number of clustering components.
|
java.nio.ByteBuffer |
collectionElement()
The value of the collection element, or null if the cell is not part
of a collection (i.e.
|
int |
compareTo(Composite that) |
int |
compareToSimple(Composite that) |
protected void |
construct(Cell from) |
CellName |
copy(CFMetaData cfm,
AbstractAllocator allocator) |
ColumnIdentifier |
cql3ColumnName(CFMetaData metadata)
The name of the CQL3 column this cell represents.
|
int |
dataSize() |
Composite |
end() |
Composite.EOC |
eoc() |
boolean |
equals(CellName that) |
boolean |
equals(java.lang.Object obj) |
java.nio.ByteBuffer |
get(int i) |
protected byte |
getByte(long offset) |
protected java.nio.ByteBuffer |
getByteBuffer(long offset,
int length) |
protected void |
getBytes(long offset,
byte[] trg,
int trgOffset,
int count) |
protected int |
getInt(long offset) |
protected long |
getLong(long offset) |
protected int |
getShort(long offset) |
protected long |
internalSize() |
boolean |
isCollectionCell() |
boolean |
isEmpty() |
boolean |
isPrefixOf(CType type,
Composite c) |
boolean |
isSameCQL3RowAs(CellNameType type,
CellName other)
Whether this cell is part of the same CQL3 row as the other cell.
|
boolean |
isStatic() |
long |
maxTimestamp() |
long |
minTimestamp() |
protected int |
postfixSize() |
protected void |
setByte(long offset,
byte b) |
protected void |
setBytes(long offset,
java.nio.ByteBuffer buffer) |
protected void |
setInt(long offset,
int l) |
protected void |
setLong(long offset,
long l) |
protected void |
setShort(long offset,
short s) |
int |
size() |
protected int |
sizeOf(Cell cell) |
ColumnSlice |
slice() |
Composite |
start() |
java.nio.ByteBuffer |
toByteBuffer() |
protected void |
updateWithName(java.security.MessageDigest digest) |
protected void |
updateWithValue(java.security.MessageDigest digest) |
java.nio.ByteBuffer |
value() |
Composite |
withEOC(Composite.EOC eoc) |
Cell |
withUpdatedName(CellName newName) |
Cell |
withUpdatedTimestamp(long newTimestamp) |
Cell |
withUpdatedTimestampAndLocalDeletionTime(long newTimestamp,
int newLocalDeletionTime) |
protected void |
writeComponentTo(java.security.MessageDigest digest,
int i,
boolean includeSize) |
protected void |
writeMemoryTo(java.security.MessageDigest digest,
int from,
int count) |
cellDataSize, create, diff, diffCounter, equals, getLocalDeletionTime, getString, hashCode, isLive, isLive, onDiskIterator, reconcile, reconcileCounter, serializationFlags, serializedSize, updateDigest, validateFields, validateNameclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitunsharedHeapSizeExcludingDataunsharedHeapSizelocalCopy, localCopy, name, unsharedHeapSizeExcludingDatatimestamppublic AbstractNativeCell(NativeAllocator allocator, OpOrder.Group writeOp, Cell copyOf)
protected int sizeOf(Cell cell)
protected void construct(Cell from)
protected int postfixSize()
public long minTimestamp()
public long maxTimestamp()
public int clusteringSize()
CellNameclusteringSize in interface CellNamepublic ColumnIdentifier cql3ColumnName(CFMetaData metadata)
CellNamecql3ColumnName in interface CellNamepublic java.nio.ByteBuffer collectionElement()
CellNamecollectionElement in interface CellNamepublic boolean isCollectionCell()
isCollectionCell in interface CellNamepublic boolean isSameCQL3RowAs(CellNameType type, CellName other)
CellNameisSameCQL3RowAs in interface CellNameprotected void writeComponentTo(java.security.MessageDigest digest,
int i,
boolean includeSize)
protected void writeMemoryTo(java.security.MessageDigest digest,
int from,
int count)
public Composite.EOC eoc()
public Composite withEOC(Composite.EOC eoc)
public ColumnSlice slice()
public boolean isPrefixOf(CType type, Composite c)
isPrefixOf in interface Compositepublic java.nio.ByteBuffer toByteBuffer()
toByteBuffer in interface Compositeprotected void updateWithName(java.security.MessageDigest digest)
protected void updateWithValue(java.security.MessageDigest digest)
public boolean equals(java.lang.Object obj)
equals in class AbstractCellpublic boolean equals(CellName that)
public CellName copy(CFMetaData cfm, AbstractAllocator allocator)
public Cell withUpdatedName(CellName newName)
withUpdatedName in interface Cellpublic Cell withUpdatedTimestamp(long newTimestamp)
withUpdatedTimestamp in interface Cellpublic Cell withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, int newLocalDeletionTime)
withUpdatedTimestampAndLocalDeletionTime in interface Cellprotected long internalSize()
protected final void setByte(long offset,
byte b)
protected final void setShort(long offset,
short s)
protected final void setInt(long offset,
int l)
protected final void setLong(long offset,
long l)
protected final void setBytes(long offset,
java.nio.ByteBuffer buffer)
protected final byte getByte(long offset)
protected final void getBytes(long offset,
byte[] trg,
int trgOffset,
int count)
protected final int getShort(long offset)
protected final int getInt(long offset)
protected final long getLong(long offset)
protected final java.nio.ByteBuffer getByteBuffer(long offset,
int length)
@Inline public final int compareTo(Composite that)
public final int compareToSimple(Composite that)
Copyright © 2018 The Apache Software Foundation