Class Rows


  • public abstract class Rows
    extends java.lang.Object
    Static utilities to work on Row objects.
    • Field Detail

      • EMPTY_STATIC_ROW

        public static final Row EMPTY_STATIC_ROW
    • Method Detail

      • simpleBuilder

        public static Row.SimpleBuilder simpleBuilder​(TableMetadata metadata,
                                                      java.lang.Object... clusteringValues)
        Creates a new simple row builder.
        Parameters:
        metadata - the metadata of the table this is a row of.
        clusteringValues - the value for the clustering columns of the row to add to this build. There may be no values if either the table has no clustering column, or if you want to edit the static row. Note that as a shortcut it is also allowed to pass a Clustering object directly, in which case that should be the only argument.
        Returns:
        a newly created builder.
      • collectStats

        public static int collectStats​(Row row,
                                       PartitionStatisticsCollector collector)
        Collect statistics on a given row.
        Parameters:
        row - the row for which to collect stats.
        collector - the stats collector.
        Returns:
        the total number of cells in row.
      • diff

        public static void diff​(RowDiffListener diffListener,
                                Row merged,
                                Row... inputs)
        Given the result (merged) of merging multiple inputs, signals the difference between each input and merged to diffListener.

        Note that this method doesn't only emit cells etc where there's a difference. The listener is informed of every corresponding entity between the merged and input rows, including those that are equal.

        Parameters:
        diffListener - the listener to which to signal the differences between the inputs and the merged result.
        merged - the result of merging inputs.
        inputs - the inputs whose merge yielded merged.
      • merge

        public static Row merge​(Row existing,
                                Row update)
      • merge

        public static Row merge​(Row existing,
                                Row update,
                                ColumnData.PostReconciliationFunction onReconcile)
        Merges two rows. In addition to reconciling the cells in each row, the liveness info, and deletion times for the row and complex columns are also merged.

        Note that this method assumes that the provided rows can meaningfully be reconciled together. That is, that the rows share the same clustering value, and belong to the same partition.

        Parameters:
        existing -
        update -
        Returns:
        the row resulting from the merge.
      • removeShadowedCells

        public static Row removeShadowedCells​(Row existing,
                                              Row update,
                                              DeletionTime rangeDeletion)
        Returns a row that is obtained from the given existing row by removing everything that is shadowed by data in the update row. In other words, produces the smallest result row such that merge(result, update, nowInSec) == merge(existing, update, nowInSec) after filtering by rangeDeletion.
        Parameters:
        existing - source row
        update - shadowing row
        rangeDeletion - extra DeletionTime from covering tombstone