Package org.apache.cassandra.db.rows
Class Cells
java.lang.Object
org.apache.cassandra.db.rows.Cells
Static methods to work on cells.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNonShadowed(Cell<?> existing, Cell<?> update, DeletionTime deletion, Row.Builder builder) Adds to the builder a representation of the given existing cell that, when merged/reconciled with the given update cell, produces the same result as merging the original with the update.static voidaddNonShadowedComplex(ColumnMetadata column, Iterator<Cell<?>> existing, Iterator<Cell<?>> update, DeletionTime deletion, Row.Builder builder) Adds to the builder a representation of the given existing cell that, when merged/reconciled with the given update cell, produces the same result as merging the original with the update.static voidcollectStats(Cell<?> cell, PartitionStatisticsCollector collector) Collect statistics ont a given cell.static <T,V> T composeValue(Cell<V> cell, AbstractType<T> type) static Cell<?>Reconciles/merge two cells.static <L,R> boolean valueEqual(Cell<L> left, Cell<R> right) static <V> StringvalueString(Cell<V> cell) static <V> StringvalueString(Cell<V> cell, AbstractType<?> type)
-
Method Details
-
collectStats
Collect statistics ont a given cell.- Parameters:
cell- the cell for which to collect stats.collector- the stats collector.
-
reconcile
Reconciles/merge two cells.Note that this method assumes that the provided cells can meaningfully be reconciled together, that is that cell are for the same row and same column (and same cell path if the column is complex).
This method is commutative over it's cells arguments:
reconcile(a, b, n) == reconcile(b, a, n).- Parameters:
c1- the first cell participating in the reconciliation.c2- the second cell participating in the reconciliation.- Returns:
- a cell corresponding to the reconciliation of
c1andc2. For non-counter cells, this will always be eitherc1orc2, but for counter cells this can be a newly allocated cell.
-
addNonShadowed
public static void addNonShadowed(Cell<?> existing, Cell<?> update, DeletionTime deletion, Row.Builder builder) Adds to the builder a representation of the given existing cell that, when merged/reconciled with the given update cell, produces the same result as merging the original with the update.For simple cells that is either the original cell (if still live), or nothing (if shadowed).
- Parameters:
existing- the pre-existing cell, the one that is updated.update- the newly added cell, the update. This can benullout of convenience, in which case this function simply copyexistingtowriter.deletion- the deletion time that applies to the cells being considered. This deletion time may delete bothexistingorupdate.builder- the row builder to which the result of the filtering is written.
-
addNonShadowedComplex
public static void addNonShadowedComplex(ColumnMetadata column, Iterator<Cell<?>> existing, Iterator<Cell<?>> update, DeletionTime deletion, Row.Builder builder) Adds to the builder a representation of the given existing cell that, when merged/reconciled with the given update cell, produces the same result as merging the original with the update.For simple cells that is either the original cell (if still live), or nothing (if shadowed).
- Parameters:
column- the complex column the cells are for.existing- the pre-existing cells, the ones that are updated.update- the newly added cells, the update. This can benullout of convenience, in which case this function simply copy the cells fromexistingtowriter.deletion- the deletion time that applies to the cells being considered. This deletion time may delete bothexistingorupdate.builder- the row builder to which the result of the filtering is written.
-
valueEqual
-
composeValue
-
valueString
-
valueString
-