public UnfilteredPartitions(UnfilteredPartitionIterator input) { super(input); this.isForThrift = input.isForThrift(); }
public UnfilteredPartitions(UnfilteredPartitionIterator input) { super(input); this.isForThrift = input.isForThrift(); }
public UnfilteredPartitions(UnfilteredPartitionIterator input) { super(input); this.isForThrift = input.isForThrift(); }
public UnfilteredPartitions(UnfilteredPartitionIterator input) { super(input); this.isForThrift = input.isForThrift(); }
protected UnfilteredPartitionIterator withoutPurgeableTombstones(UnfilteredPartitionIterator iterator, ColumnFamilyStore cfs) { final boolean isForThrift = iterator.isForThrift(); class WithoutPurgeableTombstones extends PurgeFunction { public WithoutPurgeableTombstones() { super(isForThrift, nowInSec(), cfs.gcBefore(nowInSec()), oldestUnrepairedTombstone(), cfs.getCompactionStrategyManager().onlyPurgeRepairedTombstones(), cfs.metadata.enforceStrictLiveness()); } protected Predicate<Long> getPurgeEvaluator() { return time -> true; } } return Transformation.apply(iterator, new WithoutPurgeableTombstones()); }
protected UnfilteredPartitionIterator withoutPurgeableTombstones(UnfilteredPartitionIterator iterator, ColumnFamilyStore cfs) { final boolean isForThrift = iterator.isForThrift(); class WithoutPurgeableTombstones extends PurgeFunction { public WithoutPurgeableTombstones() { super(isForThrift, nowInSec(), cfs.gcBefore(nowInSec()), oldestUnrepairedTombstone(), cfs.getCompactionStrategyManager().onlyPurgeRepairedTombstones(), cfs.metadata.enforceStrictLiveness()); } protected Predicate<Long> getPurgeEvaluator() { return time -> true; } } return Transformation.apply(iterator, new WithoutPurgeableTombstones()); }
protected UnfilteredPartitionIterator withoutPurgeableTombstones(UnfilteredPartitionIterator iterator, ColumnFamilyStore cfs) { final boolean isForThrift = iterator.isForThrift(); class WithoutPurgeableTombstones extends PurgeFunction { public WithoutPurgeableTombstones() { super(isForThrift, nowInSec(), cfs.gcBefore(nowInSec()), oldestUnrepairedTombstone(), cfs.getCompactionStrategyManager().onlyPurgeRepairedTombstones(), cfs.metadata.enforceStrictLiveness()); } protected Predicate<Long> getPurgeEvaluator() { return time -> true; } } return Transformation.apply(iterator, new WithoutPurgeableTombstones()); }
return iterators.get(0); final boolean isForThrift = iterators.get(0).isForThrift(); final CFMetaData metadata = iterators.get(0).metadata();
return iterators.get(0); final boolean isForThrift = iterators.get(0).isForThrift(); final CFMetaData metadata = iterators.get(0).metadata();
/** * Filter any RangeTombstoneMarker from the iterator's iterators, transforming it into a PartitionIterator. */ public static PartitionIterator filter(UnfilteredPartitionIterator iterator, int nowInSecs) { Filter filter = new Filter(!iterator.isForThrift(), nowInSecs); if (iterator instanceof UnfilteredPartitions) return new FilteredPartitions(filter, (UnfilteredPartitions) iterator); return new FilteredPartitions(iterator, filter); } }
/** * Filter any RangeTombstoneMarker from the iterator's iterators, transforming it into a PartitionIterator. */ public static FilteredPartitions filter(UnfilteredPartitionIterator iterator, int nowInSecs) { FilteredPartitions filtered = filter(iterator, new Filter(nowInSecs, iterator.metadata().enforceStrictLiveness())); return iterator.isForThrift() ? filtered : (FilteredPartitions) Transformation.apply(filtered, new EmptyPartitionsDiscarder()); }
/** * Filter any RangeTombstoneMarker from the iterator's iterators, transforming it into a PartitionIterator. */ public static FilteredPartitions filter(UnfilteredPartitionIterator iterator, int nowInSecs) { FilteredPartitions filtered = filter(iterator, new Filter(nowInSecs, iterator.metadata().enforceStrictLiveness())); return iterator.isForThrift() ? filtered : (FilteredPartitions) Transformation.apply(filtered, new EmptyPartitionsDiscarder()); }
/** * Filter any RangeTombstoneMarker from the iterator's iterators, transforming it into a PartitionIterator. */ public static FilteredPartitions filter(UnfilteredPartitionIterator iterator, int nowInSecs) { FilteredPartitions filtered = filter(iterator, new Filter(nowInSecs, iterator.metadata().enforceStrictLiveness())); return iterator.isForThrift() ? filtered : (FilteredPartitions) Transformation.apply(filtered, new EmptyPartitionsDiscarder()); }
public void serialize(UnfilteredPartitionIterator iter, ColumnFilter selection, DataOutputPlus out, int version) throws IOException { assert version >= MessagingService.VERSION_30; // We handle backward compatibility directy in ReadResponse.LegacyRangeSliceReplySerializer out.writeBoolean(iter.isForThrift()); while (iter.hasNext()) { out.writeBoolean(true); try (UnfilteredRowIterator partition = iter.next()) { UnfilteredRowIteratorSerializer.serializer.serialize(partition, selection, out, version); } } out.writeBoolean(false); }
public void serialize(UnfilteredPartitionIterator iter, ColumnFilter selection, DataOutputPlus out, int version) throws IOException { assert version >= MessagingService.VERSION_30; // We handle backward compatibility directy in ReadResponse.LegacyRangeSliceReplySerializer out.writeBoolean(iter.isForThrift()); while (iter.hasNext()) { out.writeBoolean(true); try (UnfilteredRowIterator partition = iter.next()) { UnfilteredRowIteratorSerializer.serializer.serialize(partition, selection, out, version); } } out.writeBoolean(false); }
public void serialize(UnfilteredPartitionIterator iter, ColumnFilter selection, DataOutputPlus out, int version) throws IOException { assert version >= MessagingService.VERSION_30; // We handle backward compatibility directy in ReadResponse.LegacyRangeSliceReplySerializer out.writeBoolean(iter.isForThrift()); while (iter.hasNext()) { out.writeBoolean(true); try (UnfilteredRowIterator partition = iter.next()) { UnfilteredRowIteratorSerializer.serializer.serialize(partition, selection, out, version); } } out.writeBoolean(false); }
public void serialize(UnfilteredPartitionIterator iter, ColumnFilter selection, DataOutputPlus out, int version) throws IOException { assert version >= MessagingService.VERSION_30; // We handle backward compatibility directy in ReadResponse.LegacyRangeSliceReplySerializer out.writeBoolean(iter.isForThrift()); while (iter.hasNext()) { out.writeBoolean(true); try (UnfilteredRowIterator partition = iter.next()) { UnfilteredRowIteratorSerializer.serializer.serialize(partition, selection, out, version); } } out.writeBoolean(false); }
@SuppressWarnings("resource") // We make sure to close mergedIterator in close() and CompactionIterator is itself an AutoCloseable public CompactionIterator(OperationType type, List<ISSTableScanner> scanners, CompactionController controller, int nowInSec, UUID compactionId, CompactionMetrics metrics) { this.controller = controller; this.type = type; this.scanners = scanners; this.nowInSec = nowInSec; this.compactionId = compactionId; this.bytesRead = 0; long bytes = 0; for (ISSTableScanner scanner : scanners) bytes += scanner.getLengthInBytes(); this.totalBytes = bytes; this.mergeCounters = new long[scanners.size()]; this.metrics = metrics; if (metrics != null) metrics.beginCompaction(this); UnfilteredPartitionIterator merged = scanners.isEmpty() ? EmptyIterators.unfilteredPartition(controller.cfs.metadata, false) : UnfilteredPartitionIterators.merge(scanners, nowInSec, listener()); boolean isForThrift = merged.isForThrift(); // to stop capture of iterator in Purger, which is confusing for debug merged = Transformation.apply(merged, new GarbageSkipper(controller, nowInSec)); this.compacted = Transformation.apply(merged, new Purger(isForThrift, controller, nowInSec)); }
@SuppressWarnings("resource") // We make sure to close mergedIterator in close() and CompactionIterator is itself an AutoCloseable public CompactionIterator(OperationType type, List<ISSTableScanner> scanners, CompactionController controller, int nowInSec, UUID compactionId, CompactionMetrics metrics) { this.controller = controller; this.type = type; this.scanners = scanners; this.nowInSec = nowInSec; this.compactionId = compactionId; this.bytesRead = 0; long bytes = 0; for (ISSTableScanner scanner : scanners) bytes += scanner.getLengthInBytes(); this.totalBytes = bytes; this.mergeCounters = new long[scanners.size()]; this.metrics = metrics; if (metrics != null) metrics.beginCompaction(this); UnfilteredPartitionIterator merged = scanners.isEmpty() ? EmptyIterators.unfilteredPartition(controller.cfs.metadata, false) : UnfilteredPartitionIterators.merge(scanners, nowInSec, listener()); boolean isForThrift = merged.isForThrift(); // to stop capture of iterator in Purger, which is confusing for debug merged = Transformation.apply(merged, new GarbageSkipper(controller, nowInSec)); this.compacted = Transformation.apply(merged, new Purger(isForThrift, controller, nowInSec)); }
@SuppressWarnings("resource") // We make sure to close mergedIterator in close() and CompactionIterator is itself an AutoCloseable public CompactionIterator(OperationType type, List<ISSTableScanner> scanners, CompactionController controller, int nowInSec, UUID compactionId, CompactionMetrics metrics) { this.controller = controller; this.type = type; this.scanners = scanners; this.nowInSec = nowInSec; this.compactionId = compactionId; this.bytesRead = 0; long bytes = 0; for (ISSTableScanner scanner : scanners) bytes += scanner.getLengthInBytes(); this.totalBytes = bytes; this.mergeCounters = new long[scanners.size()]; this.metrics = metrics; if (metrics != null) metrics.beginCompaction(this); UnfilteredPartitionIterator merged = scanners.isEmpty() ? EmptyIterators.unfilteredPartition(controller.cfs.metadata, false) : UnfilteredPartitionIterators.merge(scanners, nowInSec, listener()); boolean isForThrift = merged.isForThrift(); // to stop capture of iterator in Purger, which is confusing for debug merged = Transformation.apply(merged, new GarbageSkipper(controller, nowInSec)); this.compacted = Transformation.apply(merged, new Purger(isForThrift, controller, nowInSec)); }