Writes of incremental values are performed as normal {@code Put}s, flagged with a special attribute {@link co.cask.tigon.conf.Constants#DELTA_WRITE}. The coprocessor intercepts these writes and rewrites the cell value to use a special marker prefix.
For read (for {@code Get} and {@code Scan}) operations, all of the delta values are summed up for a column, up to and including the most recent "full" (non-delta) value. The sum of these delta values, plus the full value (if found) is returned for the column.
To mitigate the performance impact on reading, this coprocessor also overrides the scanner used in flush and compaction operations, using {@link IncrementSummingScanner} to generate a new "full" value aggregated fromall the successfully committed delta values.
|
|