Package org.apache.cassandra.db.rows
Class UnfilteredRowIteratorSerializer
- java.lang.Object
-
- org.apache.cassandra.db.rows.UnfilteredRowIteratorSerializer
-
public class UnfilteredRowIteratorSerializer extends java.lang.ObjectSerialize/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 byColumnIndex.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUnfilteredRowIteratorSerializer.Header
-
Field Summary
Fields Modifier and Type Field Description static intIS_EMPTYprotected static org.slf4j.Loggerloggerstatic UnfilteredRowIteratorSerializerserializer
-
Constructor Summary
Constructors Constructor Description UnfilteredRowIteratorSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnfilteredRowIteratordeserialize(DataInputPlus in, int version, TableMetadata metadata, ColumnFilter selection, DeserializationHelper.Flag flag)UnfilteredRowIteratordeserialize(DataInputPlus in, int version, TableMetadata metadata, DeserializationHelper.Flag flag, UnfilteredRowIteratorSerializer.Header header)UnfilteredRowIteratorSerializer.HeaderdeserializeHeader(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 Detail
-
logger
protected static final org.slf4j.Logger logger
-
IS_EMPTY
public static final int IS_EMPTY
- See Also:
- Constant Field Values
-
serializer
public static final UnfilteredRowIteratorSerializer serializer
-
-
Method Detail
-
serialize
public void serialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version) throws java.io.IOException
- Throws:
java.io.IOException
-
serialize
public void serialize(UnfilteredRowIterator iterator, ColumnFilter selection, DataOutputPlus out, int version, int rowEstimate) throws java.io.IOException
- Throws:
java.io.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 java.io.IOException
- Throws:
java.io.IOException
-
deserialize
public UnfilteredRowIterator deserialize(DataInputPlus in, int version, TableMetadata metadata, DeserializationHelper.Flag flag, UnfilteredRowIteratorSerializer.Header header) throws java.io.IOException
- Throws:
java.io.IOException
-
deserialize
public UnfilteredRowIterator deserialize(DataInputPlus in, int version, TableMetadata metadata, ColumnFilter selection, DeserializationHelper.Flag flag) throws java.io.IOException
- Throws:
java.io.IOException
-
-