org.apache.cassandra.db.rows

## Class UnfilteredSerializer

- java.lang.Object
- - org.apache.cassandra.db.rows.UnfilteredSerializer

-     public class UnfilteredSerializer
      extends java.lang.Object

  Serialize/deserialize a single Unfiltered (both on-wire and on-disk).

  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:
      - Simple columns are simply encoded as one `<cell>`
      - Complex columns are encoded as `[<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`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static UnfilteredSerializer` | `serializer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnfilteredSerializer()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Unfiltered` | `deserialize(DataInputPlus in, SerializationHeader header, SerializationHelper helper, Row.Builder builder)` Deserialize an `Unfiltered` from the provided input.
    `RangeTombstoneMarker` | `deserializeMarkerBody(DataInputPlus in, SerializationHeader header, ClusteringBoundOrBoundary bound)`
    `Row` | `deserializeRowBody(DataInputPlus in, SerializationHeader header, SerializationHelper helper, int flags, int extendedFlags, Row.Builder builder)`
    `Row` | `deserializeStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper)`
    `Unfiltered` | `deserializeTombstonesOnly(FileDataInput in, SerializationHeader header, SerializationHelper helper)`
    `static boolean` | `hasExtendedFlags(Row row)`
    `static boolean` | `isEndOfPartition(int flags)`
    `static boolean` | `isStatic(int extendedFlags)`
    `static Unfiltered.Kind` | `kind(int flags)`
    `static int` | `readExtendedFlags(DataInputPlus in, int flags)`
    `void` | `serialize(Unfiltered unfiltered, SerializationHeader header, DataOutputPlus out, int version)`
    `void` | `serialize(Unfiltered unfiltered, SerializationHeader header, DataOutputPlus out, long previousUnfilteredSize, int version)`
    `long` | `serializedSize(Unfiltered unfiltered, SerializationHeader header, int version)`
    `long` | `serializedSize(Unfiltered unfiltered, SerializationHeader header, long previousUnfilteredSize, int version)`
    `long` | `serializedSizeEndOfPartition()`
    `void` | `serializeStaticRow(Row row, SerializationHeader header, DataOutputPlus out, int version)`
    `void` | `skipMarkerBody(DataInputPlus in)`
    `void` | `skipRowBody(DataInputPlus in)`
    `void` | `skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper)`
    `void` | `writeEndOfPartition(DataOutputPlus out)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serializer

          public static final UnfilteredSerializer serializer

  - ### Constructor Detail

    - #### UnfilteredSerializer

          public UnfilteredSerializer()

  - ### Method Detail

    - #### serialize

          public void serialize(Unfiltered unfiltered,
                                SerializationHeader header,
                                DataOutputPlus out,
                                int version)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### serialize

          public void serialize(Unfiltered unfiltered,
                                SerializationHeader header,
                                DataOutputPlus out,
                                long previousUnfilteredSize,
                                int version)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### serializeStaticRow

          public void serializeStaticRow(Row row,
                                         SerializationHeader header,
                                         DataOutputPlus out,
                                         int version)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### serializedSize

          public long serializedSize(Unfiltered unfiltered,
                                     SerializationHeader header,
                                     int version)

    - #### serializedSize

          public long serializedSize(Unfiltered unfiltered,
                                     SerializationHeader header,
                                     long previousUnfilteredSize,
                                     int version)

    - #### writeEndOfPartition

          public void writeEndOfPartition(DataOutputPlus out)
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### serializedSizeEndOfPartition

          public long serializedSizeEndOfPartition()

    - #### deserialize

          public Unfiltered deserialize(DataInputPlus in,
                                        SerializationHeader header,
                                        SerializationHelper helper,
                                        Row.Builder builder)
                                 throws java.io.IOException

      Deserialize an `Unfiltered` from the provided input.
      Parameters:
        `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.
      Returns:
        the deserialized `Unfiltered` or `null` if we've read the end of a partition. This method is guaranteed to never return empty rows.
      Throws:
        `java.io.IOException`

    - #### deserializeTombstonesOnly

          public Unfiltered deserializeTombstonesOnly(FileDataInput in,
                                                      SerializationHeader header,
                                                      SerializationHelper helper)
                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deserializeStaticRow

          public Row deserializeStaticRow(DataInputPlus in,
                                          SerializationHeader header,
                                          SerializationHelper helper)
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deserializeMarkerBody

          public RangeTombstoneMarker deserializeMarkerBody(DataInputPlus in,
                                                            SerializationHeader header,
                                                            ClusteringBoundOrBoundary bound)
                                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deserializeRowBody

          public Row deserializeRowBody(DataInputPlus in,
                                        SerializationHeader header,
                                        SerializationHelper helper,
                                        int flags,
                                        int extendedFlags,
                                        Row.Builder builder)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### skipRowBody

          public void skipRowBody(DataInputPlus in)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### skipStaticRow

          public void skipStaticRow(DataInputPlus in,
                                    SerializationHeader header,
                                    SerializationHelper helper)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### skipMarkerBody

          public void skipMarkerBody(DataInputPlus in)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### isEndOfPartition

          public static boolean isEndOfPartition(int flags)

    - #### kind

          public static Unfiltered.Kind kind(int flags)

    - #### isStatic

          public static boolean isStatic(int extendedFlags)

    - #### readExtendedFlags

          public static int readExtendedFlags(DataInputPlus in,
                                              int flags)
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### hasExtendedFlags

          public static boolean hasExtendedFlags(Row row)

Copyright © 2018 The Apache Software Foundation