Package org.apache.cassandra.db.rows
Class UnfilteredRowIteratorSerializer
java.lang.Object
org.apache.cassandra.db.rows.UnfilteredRowIteratorSerializer
Serialize/Deserialize an unfiltered row iterator.
The serialization is composed of a header, follows by the rows and range tombstones of the iterator serialized
until we read the end of the partition (see UnfilteredSerializer for details). The header itself
is:
<cfid><key><flags><s_header>[<partition_deletion>][<static_row>][<row_estimate>]
where:
<cfid> is the table cfid.
<key> is the partition key.
<flags> contains bit flags. Each flag is set if it's corresponding bit is set. From rightmost
bit to leftmost one, the flags are:
- is empty: whether the iterator is empty. If so, nothing follows the <flags>
- is reversed: whether the iterator is in reversed clustering order
- has partition deletion: whether or not there is a <partition_deletion> following
- has static row: whether or not there is a <static_row> following
- has row estimate: whether or not there is a <row_estimate> following
<s_header> is the {@code SerializationHeader}. It contains in particular the columns contains in the serialized
iterator as well as other information necessary to decoding the serialized rows
(see {@code SerializationHeader.Serializer for details}).
<partition_deletion> is the deletion time for the partition (delta-encoded)
<static_row> is the static row for this partition as serialized by UnfilteredSerializer.
<row_estimate> is the (potentially estimated) number of rows serialized. This is only used for
the purpose of sizing on the receiving end and should not be relied upon too strongly.
Please note that the format described above is the on-wire format. On-disk, the format is basically the
same, but the header is written once per sstable, not once per-partition. Further, the actual row and
range tombstones are not written using this class, but rather by BigFormatPartitionWriter.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected static final org.slf4j.Loggerstatic final UnfilteredRowIteratorSerializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(DataInputPlus in, int version, TableMetadata metadata, ColumnFilter selection, DeserializationHelper.Flag flag) deserialize(DataInputPlus in, int version, TableMetadata metadata, DeserializationHelper.Flag flag, UnfilteredRowIteratorSerializer.Header header) deserializeHeader(TableMetadata metadata, ColumnFilter selection, DataInputPlus in, int version, DeserializationHelper.Flag flag) voidserialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version) voidserialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version, int rowEstimate) longserializedSize(UnfilteredRowIterator iterator, ColumnFilter selection, int version, int rowEstimate)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
IS_EMPTY
public static final int IS_EMPTY- See Also:
-
serializer
-
-
Constructor Details
-
UnfilteredRowIteratorSerializer
public UnfilteredRowIteratorSerializer()
-
-
Method Details
-
serialize
public void serialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version) throws IOException - Throws:
IOException
-
serialize
public void serialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version, int rowEstimate) throws IOException - Throws:
IOException
-
serializedSize
public long serializedSize(UnfilteredRowIterator iterator, ColumnFilter selection, int version, int rowEstimate) -
deserializeHeader
public UnfilteredRowIteratorSerializer.Header deserializeHeader(TableMetadata metadata, ColumnFilter selection, DataInputPlus in, int version, DeserializationHelper.Flag flag) throws IOException - Throws:
IOException
-
deserialize
public UnfilteredRowIterator deserialize(DataInputPlus in, int version, TableMetadata metadata, DeserializationHelper.Flag flag, UnfilteredRowIteratorSerializer.Header header) throws IOException - Throws:
IOException
-
deserialize
public UnfilteredRowIterator deserialize(DataInputPlus in, int version, TableMetadata metadata, ColumnFilter selection, DeserializationHelper.Flag flag) throws IOException - Throws:
IOException
-