@Override public Row applyToStatic(Row row) { if (!row.isEmpty()) cellCount += Rows.collectStats(row, collector); return row; }
public Row applyToRow(Row row) { if (row == null) return null; return Rows.copy(row, HeapAllocator.instance.cloningBTreeRowBuilder()).build(); }
public static Row merge(Row row1, Row row2, int nowInSec) { Row.Builder builder = BTreeRow.sortedBuilder(); merge(row1, row2, builder, nowInSec); return builder.build(); }
Rows.diff(diffListener, merged, versions);
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
/** * Writes the current partition count and size estimates into SIZE_ESTIMATES_CF */ public static void updateSizeEstimates(String keyspace, String table, Map<Range<Token>, Pair<Long, Long>> estimates) { long timestamp = FBUtilities.timestampMicros(); PartitionUpdate update = new PartitionUpdate(SizeEstimates, UTF8Type.instance.decompose(keyspace), SizeEstimates.partitionColumns(), estimates.size()); Mutation mutation = new Mutation(update); // delete all previous values with a single range tombstone. int nowInSec = FBUtilities.nowInSeconds(); update.add(new RangeTombstone(Slice.make(SizeEstimates.comparator, table), new DeletionTime(timestamp - 1, nowInSec))); // add a CQL row for each primary token range. for (Map.Entry<Range<Token>, Pair<Long, Long>> entry : estimates.entrySet()) { Range<Token> range = entry.getKey(); Pair<Long, Long> values = entry.getValue(); update.add(Rows.simpleBuilder(SizeEstimates, table, range.left.toString(), range.right.toString()) .timestamp(timestamp) .add("partitions_count", values.left) .add("mean_partition_size", values.right) .build()); } mutation.apply(); }
ColumnData cura = comparison <= 0 ? nexta : null; ColumnData curb = comparison >= 0 ? nextb : null; ColumnDefinition column = getColumnDefinition(cura, curb);
Rows.diff(diffListener, merged, versions);
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
/** * Writes the current partition count and size estimates into SIZE_ESTIMATES_CF */ public static void updateSizeEstimates(String keyspace, String table, Map<Range<Token>, Pair<Long, Long>> estimates) { long timestamp = FBUtilities.timestampMicros(); PartitionUpdate update = new PartitionUpdate(SizeEstimates, UTF8Type.instance.decompose(keyspace), SizeEstimates.partitionColumns(), estimates.size()); Mutation mutation = new Mutation(update); // delete all previous values with a single range tombstone. int nowInSec = FBUtilities.nowInSeconds(); update.add(new RangeTombstone(Slice.make(SizeEstimates.comparator, table), new DeletionTime(timestamp - 1, nowInSec))); // add a CQL row for each primary token range. for (Map.Entry<Range<Token>, Pair<Long, Long>> entry : estimates.entrySet()) { Range<Token> range = entry.getKey(); Pair<Long, Long> values = entry.getValue(); update.add(Rows.simpleBuilder(SizeEstimates, table, range.left.toString(), range.right.toString()) .timestamp(timestamp) .add("partitions_count", values.left) .add("mean_partition_size", values.right) .build()); } mutation.apply(); }
ColumnData cura = comparison <= 0 ? nexta : null; ColumnData curb = comparison >= 0 ? nextb : null; ColumnDefinition column = getColumnDefinition(cura, curb);
private BTree.Builder<Row> builder(int initialCapacity) { return BTree.<Row>builder(metadata.comparator, initialCapacity) .setQuickResolver((a, b) -> Rows.merge(a, b, createdAtInSec)); }
@Override public Row applyToStatic(Row row) { if (!row.isEmpty()) cellCount += Rows.collectStats(row, collector); return row; }
public Row applyToRow(Row row) { if (row == null) return null; return Rows.copy(row, HeapAllocator.instance.cloningBTreeRowBuilder()).build(); }
Rows.diff(diffListener, merged, versions);
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
/** * Writes the current partition count and size estimates into SIZE_ESTIMATES_CF */ public static void updateSizeEstimates(String keyspace, String table, Map<Range<Token>, Pair<Long, Long>> estimates) { long timestamp = FBUtilities.timestampMicros(); PartitionUpdate update = new PartitionUpdate(SizeEstimates, UTF8Type.instance.decompose(keyspace), SizeEstimates.partitionColumns(), estimates.size()); Mutation mutation = new Mutation(update); // delete all previous values with a single range tombstone. int nowInSec = FBUtilities.nowInSeconds(); update.add(new RangeTombstone(Slice.make(SizeEstimates.comparator, table), new DeletionTime(timestamp - 1, nowInSec))); // add a CQL row for each primary token range. for (Map.Entry<Range<Token>, Pair<Long, Long>> entry : estimates.entrySet()) { Range<Token> range = entry.getKey(); Pair<Long, Long> values = entry.getValue(); update.add(Rows.simpleBuilder(SizeEstimates, table, range.left.toString(), range.right.toString()) .timestamp(timestamp) .add("partitions_count", values.left) .add("mean_partition_size", values.right) .build()); } mutation.apply(); }
ColumnData cura = comparison <= 0 ? nexta : null; ColumnData curb = comparison >= 0 ? nextb : null; ColumnDefinition column = getColumnDefinition(cura, curb);
private BTree.Builder<Row> builder(int initialCapacity) { return BTree.<Row>builder(metadata.comparator, initialCapacity) .setQuickResolver((a, b) -> Rows.merge(a, b, createdAtInSec)); }
@Override public Row applyToStatic(Row row) { if (!row.isEmpty()) cellCount += Rows.collectStats(row, collector); return row; }