Package org.apache.cassandra.db.rows
Class Rows
- java.lang.Object
-
- org.apache.cassandra.db.rows.Rows
-
public abstract class Rows extends java.lang.Object
Static utilities to work on Row objects.
-
-
Field Summary
Fields Modifier and Type Field Description static Row
EMPTY_STATIC_ROW
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
collectStats(Row row, PartitionStatisticsCollector collector)
Collect statistics on a given row.static void
diff(RowDiffListener diffListener, Row merged, Row... inputs)
Given the result (merged
) of merging multipleinputs
, signals the difference between each input andmerged
todiffListener
.static Row
merge(Row existing, Row update)
static Row
merge(Row existing, Row update, ColumnData.PostReconciliationFunction onReconcile)
Merges two rows.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.static Row.SimpleBuilder
simpleBuilder(TableMetadata metadata, java.lang.Object... clusteringValues)
Creates a new simple row builder.
-
-
-
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 aClustering
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 multipleinputs
, signals the difference between each input andmerged
todiffListener
.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 merginginputs
.inputs
- the inputs whose merge yieldedmerged
.
-
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 thatmerge(result, update, nowInSec) == merge(existing, update, nowInSec)
after filtering by rangeDeletion.- Parameters:
existing
- source rowupdate
- shadowing rowrangeDeletion
- extraDeletionTime
from covering tombstone
-
-