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, indicates the presence of a 2ndbyte that contains more
flags. If the extension is not set, defaults are assumed for the flags
of that 2nd byte.
<row>
is
<clustering><sizes>[<pkliveness>][<deletion>][<columns>]<columns_data>
where:
<clustering>
is the row clustering as serialized by
Clustering.Serializer
(note that static row are an
exception and don't have this). <sizes>
are the sizes of the whole unfiltered on disk and
of the previous unfiltered. This is only present for sstables and
is used to efficiently skip rows (both forward and backward).<pkliveness>
is the row primary key liveness infos, and it
contains the timestamp, ttl and local deletion time of that info,
though some/all of those can be absent based on the flags. deletion
is the row deletion. It's presence is determined
by the flags and if present, it conists of both the deletion
timestamp and local deletion time.<columns>
are the columns present in the row encoded by
Columns.Serializer.serializeSubset(java.util.Collection<org.apache.cassandra.config.ColumnDefinition>, org.apache.cassandra.db.Columns, org.apache.cassandra.io.util.DataOutputPlus)
. It is absent if the row
contains all the columns of the SerializationHeader
(which
is then indicated by a flag). <columns_data>
is the data for each of the column present
in the row. The encoding of each data depends on whether the data
is for a simple or complex column:
<cell>
[<delTime>]<n><cell1>...<celln>
where <delTime>
is the deletion for this complex
column (if flags indicates its presence), <n>
is the
vint encoded value of n, i.e. <celln>
's 1-based
inde and <celli>
are the <cell>
for this
complex column<marker>
is <bound><deletion>
where <bound>
is
the marker bound as serialized by ClusteringBoundOrBoundary.Serializer
and <deletion>
is the marker deletion time.
The serialization of a <cell>
is defined by Cell.Serializer
.
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
Unfiltered
from the provided input.in
- the input from which to deserialize.header
- serialization header corresponding to the serialized data.helper
- the helper to use for deserialization.builder
- a row builder, passed here so we don't allocate a new one for every new row.Unfiltered
or null
if we've read the end of a partition. This method is
guaranteed to never return empty rows.java.io.IOException
public Unfiltered deserializeTombstonesOnly(FileDataInput in, SerializationHeader header, SerializationHelper helper) 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, ClusteringBoundOrBoundary 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 © 2018 The Apache Software Foundation