@ -17,14 +17,15 @@ CompactionIterator::CompactionIterator(
SequenceNumber last_sequence , std : : vector < SequenceNumber > * snapshots ,
SequenceNumber last_sequence , std : : vector < SequenceNumber > * snapshots ,
SequenceNumber earliest_write_conflict_snapshot ,
SequenceNumber earliest_write_conflict_snapshot ,
const SnapshotChecker * snapshot_checker , Env * env ,
const SnapshotChecker * snapshot_checker , Env * env ,
bool expect_valid_internal_key , RangeDelAggregator * range_del_agg ,
bool report_detailed_time , bool expect_valid_internal_key ,
RangeDelAggregator * range_del_agg ,
const Compaction * compaction , const CompactionFilter * compaction_filter ,
const Compaction * compaction , const CompactionFilter * compaction_filter ,
const std : : atomic < bool > * shutting_down ,
const std : : atomic < bool > * shutting_down ,
const SequenceNumber preserve_deletes_seqnum )
const SequenceNumber preserve_deletes_seqnum )
: CompactionIterator (
: CompactionIterator (
input , cmp , merge_helper , last_sequence , snapshots ,
input , cmp , merge_helper , last_sequence , snapshots ,
earliest_write_conflict_snapshot , snapshot_checker , env ,
earliest_write_conflict_snapshot , snapshot_checker , env ,
expect_valid_internal_key , range_del_agg ,
report_detailed_time , expect_valid_internal_key , range_del_agg ,
std : : unique_ptr < CompactionProxy > (
std : : unique_ptr < CompactionProxy > (
compaction ? new CompactionProxy ( compaction ) : nullptr ) ,
compaction ? new CompactionProxy ( compaction ) : nullptr ) ,
compaction_filter , shutting_down , preserve_deletes_seqnum ) { }
compaction_filter , shutting_down , preserve_deletes_seqnum ) { }
@ -34,7 +35,8 @@ CompactionIterator::CompactionIterator(
SequenceNumber /*last_sequence*/ , std : : vector < SequenceNumber > * snapshots ,
SequenceNumber /*last_sequence*/ , std : : vector < SequenceNumber > * snapshots ,
SequenceNumber earliest_write_conflict_snapshot ,
SequenceNumber earliest_write_conflict_snapshot ,
const SnapshotChecker * snapshot_checker , Env * env ,
const SnapshotChecker * snapshot_checker , Env * env ,
bool expect_valid_internal_key , RangeDelAggregator * range_del_agg ,
bool report_detailed_time , bool expect_valid_internal_key ,
RangeDelAggregator * range_del_agg ,
std : : unique_ptr < CompactionProxy > compaction ,
std : : unique_ptr < CompactionProxy > compaction ,
const CompactionFilter * compaction_filter ,
const CompactionFilter * compaction_filter ,
const std : : atomic < bool > * shutting_down ,
const std : : atomic < bool > * shutting_down ,
@ -46,6 +48,7 @@ CompactionIterator::CompactionIterator(
earliest_write_conflict_snapshot_ ( earliest_write_conflict_snapshot ) ,
earliest_write_conflict_snapshot_ ( earliest_write_conflict_snapshot ) ,
snapshot_checker_ ( snapshot_checker ) ,
snapshot_checker_ ( snapshot_checker ) ,
env_ ( env ) ,
env_ ( env ) ,
report_detailed_time_ ( report_detailed_time ) ,
expect_valid_internal_key_ ( expect_valid_internal_key ) ,
expect_valid_internal_key_ ( expect_valid_internal_key ) ,
range_del_agg_ ( range_del_agg ) ,
range_del_agg_ ( range_del_agg ) ,
compaction_ ( std : : move ( compaction ) ) ,
compaction_ ( std : : move ( compaction ) ) ,
@ -171,12 +174,12 @@ void CompactionIterator::InvokeFilterIfNeeded(bool* need_skip,
// to get sequence number.
// to get sequence number.
Slice & filter_key = ikey_ . type = = kTypeValue ? ikey_ . user_key : key_ ;
Slice & filter_key = ikey_ . type = = kTypeValue ? ikey_ . user_key : key_ ;
{
{
StopWatchNano timer ( env_ , true ) ;
StopWatchNano timer ( env_ , report_detailed_time_ ) ;
filter = compaction_filter_ - > FilterV2 (
filter = compaction_filter_ - > FilterV2 (
compaction_ - > level ( ) , filter_key , value_type , value_ ,
compaction_ - > level ( ) , filter_key , value_type , value_ ,
& compaction_filter_value_ , compaction_filter_skip_until_ . rep ( ) ) ;
& compaction_filter_value_ , compaction_filter_skip_until_ . rep ( ) ) ;
iter_stats_ . total_filter_time + =
iter_stats_ . total_filter_time + =
env_ ! = nullptr ? timer . ElapsedNanos ( ) : 0 ;
env_ ! = nullptr & & report_detailed_time_ ? timer . ElapsedNanos ( ) : 0 ;
}
}
if ( filter = = CompactionFilter : : Decision : : kRemoveAndSkipUntil & &
if ( filter = = CompactionFilter : : Decision : : kRemoveAndSkipUntil & &