public static class LegacyLayout.CellGrouper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
CFMetaData |
metadata |
Constructor and Description |
---|
CellGrouper(CFMetaData metadata,
SerializationHelper helper) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAtom(LegacyLayout.LegacyAtom atom)
Try adding the provided atom to the currently grouped row.
|
Clustering |
currentRowClustering()
The clustering of the current row of the cell grouper, or
null if no row is currently started. |
Row |
getRow()
Generates the row currently grouped by this grouper and reset it for the following row.
|
void |
reset() |
boolean |
startsAfterCurrentRow(LegacyLayout.LegacyRangeTombstone rangeTombstone)
Whether the provided range tombstone starts strictly after the current row of the cell grouper (if no row is
currently started, this return false).
|
static LegacyLayout.CellGrouper |
staticGrouper(CFMetaData metadata,
SerializationHelper helper) |
public final CFMetaData metadata
public CellGrouper(CFMetaData metadata, SerializationHelper helper)
public static LegacyLayout.CellGrouper staticGrouper(CFMetaData metadata, SerializationHelper helper)
public void reset()
public boolean addAtom(LegacyLayout.LegacyAtom atom)
atom
- the new atom to try to add. This must be a "row" atom, that is either a cell or a legacy
range tombstone that covers only one row (row deletion) or a subset of it (collection
deletion). Meaning that legacy range tombstone covering multiple rows (that should be handled as
legit range tombstone in the new storage engine) should be handled separately. Atoms should also
be provided in proper clustering order.true
if the provided atom has been "consumed" by this grouper (this does _not_ mean the
atom has been "used" by the grouper as the grouper will skip some shadowed atoms for instance, just
that getRow()
shouldn't be called just yet if there is more atom in the atom iterator we're
grouping). false
otherwise, that is if the row currently built by this grouper is done
_without_ the provided atom being "consumed" (and so getRow()
should be called and the
grouper resetted, after which the provided atom should be provided again).public boolean startsAfterCurrentRow(LegacyLayout.LegacyRangeTombstone rangeTombstone)
public Clustering currentRowClustering()
null
if no row is currently started.public Row getRow()
Note that the only correct way to call this is when either all the atom we're trying to group has been
consumed, or when #addAtom(LegacyAtom)
returns false
.
null
in the rare case where all the atoms
"consumed" by #addAtom(LegacyAtom)
for this row were skipped (we skip atoms under a few conditions).Copyright © 2021 The Apache Software Foundation