public class UnfilteredSerializer
extends java.lang.Object
The encoded format for an unfiltered is <flags>(<row>|<marker>) where:
<flags> is a byte (or two) whose bits are flags used by the rest of the serialization. Each
flag is defined/explained below as the "Unfiltered flags" constants. One of those flags
is an extension flag, and if present, trigger the rid of another byte that contains more
flags. If the extension is not set, defaults are assumed for the flags of that 2nd byte.
<row> is <clustering><size>[<timestamp>][<ttl>][<deletion>]<sc1>...<sci><cc1>...<ccj> where
<clustering> is the row clustering as serialized by {@code Clustering.serializer} (note
that static row are an exception and don't have this).
<size> is the size of the whole unfiltered on disk (it's only used for sstables and is
used to efficiently skip rows).
<timestamp>, <ttl> and <deletion> are the row timestamp, ttl and deletion
whose presence is determined by the flags. <sci> is the simple columns of the row and <ccj> the
complex ones.
The columns for the row are then serialized if they differ from those in the header,
and each cell then follows:
* Each simple column <sci> will simply be a <cell>
(which might have no value, see below),
* Each <ccj> will be [<delTime>]<n><cell1>...<celln> where <delTime>
is the deletion for this complex column (if flags indicates it present), <n>
is the vint encoded value of n, i.e. <celln>'s 1-based index, <celli>
are the <cell> for this complex column
<marker> is <bound><deletion> where <bound> is the marker bound as serialized
by {@code Slice.Bound.serializer} and <deletion> is the marker deletion
time.
<cell> A cell start with a 1 byte <flag>. The 2nd and third flag bits indicate if
it's a deleted or expiring cell. The 4th flag indicates if the value
is empty or not. The 5th and 6th indicates if the timestamp and ttl/
localDeletionTime for the cell are the same than the row one (if that
is the case, those are not repeated for the cell).Follows the <value>
(unless it's marked empty in the flag) and a delta-encoded long <timestamp>
(unless the flag tells to use the row level one).
Then if it's a deleted or expiring cell a delta-encoded int <localDelTime>
and if it's expiring a delta-encoded int <ttl> (unless it's an expiring cell
and the ttl and localDeletionTime are indicated by the flags to be the same
than the row ones, in which case none of those appears).
Modifier and Type | Field and Description |
---|---|
static UnfilteredSerializer |
serializer |
Constructor and Description |
---|
UnfilteredSerializer() |
public static final UnfilteredSerializer serializer
public void serialize(Unfiltered unfiltered, SerializationHeader header, DataOutputPlus out, int version) throws java.io.IOException
java.io.IOException
public void serialize(Unfiltered unfiltered, SerializationHeader header, DataOutputPlus out, long previousUnfilteredSize, int version) throws java.io.IOException
java.io.IOException
public void serializeStaticRow(Row row, SerializationHeader header, DataOutputPlus out, int version) throws java.io.IOException
java.io.IOException
public long serializedSize(Unfiltered unfiltered, SerializationHeader header, int version)
public long serializedSize(Unfiltered unfiltered, SerializationHeader header, long previousUnfilteredSize, int version)
public void writeEndOfPartition(DataOutputPlus out) throws java.io.IOException
java.io.IOException
public long serializedSizeEndOfPartition()
public Unfiltered deserialize(DataInputPlus in, SerializationHeader header, SerializationHelper helper, Row.Builder builder) throws java.io.IOException
java.io.IOException
public Row deserializeStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws java.io.IOException
java.io.IOException
public RangeTombstoneMarker deserializeMarkerBody(DataInputPlus in, SerializationHeader header, RangeTombstone.Bound bound) throws java.io.IOException
java.io.IOException
public Row deserializeRowBody(DataInputPlus in, SerializationHeader header, SerializationHelper helper, int flags, int extendedFlags, Row.Builder builder) throws java.io.IOException
java.io.IOException
public void skipRowBody(DataInputPlus in) throws java.io.IOException
java.io.IOException
public void skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws java.io.IOException
java.io.IOException
public void skipMarkerBody(DataInputPlus in) throws java.io.IOException
java.io.IOException
public static boolean isEndOfPartition(int flags)
public static Unfiltered.Kind kind(int flags)
public static boolean isStatic(int extendedFlags)
public static int readExtendedFlags(DataInputPlus in, int flags) throws java.io.IOException
java.io.IOException
public static boolean hasExtendedFlags(Row row)
Copyright © 2016 The Apache Software Foundation