org.apache.cassandra.db.rows

## Interface RowDiffListener

-     public interface RowDiffListener

  Interface that allows to act on the result of merging multiple rows. More precisely, given N rows and the result of merging them, one can call `Rows.diff(RowDiffListener, Row, Row...)` with a `RowDiffListener` and that listener will be informed for each input row of the diff between that input and merge row.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onCell(int i, Clustering clustering, Cell merged, Cell original)` Called for any cell that is either in the merged row or in input `i`.
    `void` | `onComplexDeletion(int i, Clustering clustering, ColumnDefinition column, DeletionTime merged, DeletionTime original)` Called for every (non-live) complex deletion of any complex column present in either the merged row of input `i`.
    `void` | `onDeletion(int i, Clustering clustering, Row.Deletion merged, Row.Deletion original)` Called for the row deletion of input `i`.
    `void` | `onPrimaryKeyLivenessInfo(int i, Clustering clustering, LivenessInfo merged, LivenessInfo original)` Called for the row primary key liveness info of input `i`.

- - ### Method Detail

    - #### onPrimaryKeyLivenessInfo

          void onPrimaryKeyLivenessInfo(int i,
                                        Clustering clustering,
                                        LivenessInfo merged,
                                        LivenessInfo original)

      Called for the row primary key liveness info of input `i`.
      Parameters:
        `i` - the input row from which `original` is from.
        `clustering` - the clustering for the row that is merged.
        `merged` - the primary key liveness info of the merged row. Will be `null` if input `i` had a `LivenessInfo`, but the merged result don't (i.e. the original info has been shadowed/deleted).
        `original` - the primary key liveness info of input `i`. May be `null` if input `i` has not primary key liveness info (i.e. it has `LivenessInfo.NONE`) but the merged result has.

    - #### onDeletion

          void onDeletion(int i,
                          Clustering clustering,
                          Row.Deletion merged,
                          Row.Deletion original)

      Called for the row deletion of input `i`.
      Parameters:
        `i` - the input row from which `original` is from.
        `clustering` - the clustering for the row that is merged.
        `merged` - the deletion of the merged row. Will be `null` if input `i` had deletion but the merged result doesn't (i.e. the deletion has been shadowed).
        `original` - the deletion of input `i`. May be `null` if input `i` had no deletion but the merged row has.

    - #### onComplexDeletion

          void onComplexDeletion(int i,
                                 Clustering clustering,
                                 ColumnDefinition column,
                                 DeletionTime merged,
                                 DeletionTime original)

      Called for every (non-live) complex deletion of any complex column present in either the merged row of input `i`.
      Parameters:
        `i` - the input row from which `original` is from.
        `clustering` - the clustering for the row that is merged.
        `column` - the column for which this is a complex deletion of.
        `merged` - the complex deletion of the merged row. Will be `null` if input `i` had a complex deletion for `column` but the merged result doesn't (i.e. the deletion has been shadowed).
        `original` - the complex deletion of input `i` for column `column`. May be `null` if input `i` had no complex deletion but the merged row has.

    - #### onCell

          void onCell(int i,
                      Clustering clustering,
                      Cell merged,
                      Cell original)

      Called for any cell that is either in the merged row or in input `i`.
      Parameters:
        `i` - the input row from which `original` is from.
        `clustering` - the clustering for the row that is merged.
        `merged` - the cell of the merged row. Will be `null` if input `i` had a cell but that cell is no present in the merged result (it has been deleted/shadowed).
        `original` - the cell of input `i`. May be `null` if input `i` had cell corresponding to `merged`.

Copyright © 2018 The Apache Software Foundation