@ -220,45 +220,43 @@ std::unique_ptr<FilterBlockReader> PartitionedFilterBlockReader::Create(
bool PartitionedFilterBlockReader : : KeyMayMatch (
const Slice & key , const bool no_io , const Slice * const const_ikey_ptr ,
GetContext * get_context , BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ) {
const ReadOptions & read_options ) {
assert ( const_ikey_ptr ! = nullptr ) ;
if ( ! whole_key_filtering ( ) ) {
return true ;
}
return MayMatch ( key , no_io , const_ikey_ptr , get_context , lookup_context ,
rate_limiter_priority , & FullFilterBlockReader : : KeyMayMatch ) ;
read_options , & FullFilterBlockReader : : KeyMayMatch ) ;
}
void PartitionedFilterBlockReader : : KeysMayMatch (
MultiGetRange * range , const bool no_io ,
BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ) {
BlockCacheLookupContext * lookup_context , const ReadOptions & read_options ) {
if ( ! whole_key_filtering ( ) ) {
return ; // Any/all may match
}
MayMatch ( range , nullptr , no_io , lookup_context , rate_limiter_priority ,
MayMatch ( range , nullptr , no_io , lookup_context , read_options ,
& FullFilterBlockReader : : KeysMayMatch2 ) ;
}
bool PartitionedFilterBlockReader : : PrefixMayMatch (
const Slice & prefix , const bool no_io , const Slice * const const_ikey_ptr ,
GetContext * get_context , BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ) {
const ReadOptions & read_options ) {
assert ( const_ikey_ptr ! = nullptr ) ;
return MayMatch ( prefix , no_io , const_ikey_ptr , get_context , lookup_context ,
rate_limiter_priority ,
& FullFilterBlockReader : : PrefixMayMatch ) ;
read_options , & FullFilterBlockReader : : PrefixMayMatch ) ;
}
void PartitionedFilterBlockReader : : PrefixesMayMatch (
MultiGetRange * range , const SliceTransform * prefix_extractor ,
const bool no_io , BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ) {
const ReadOptions & read_options ) {
assert ( prefix_extractor ) ;
MayMatch ( range , prefix_extractor , no_io , lookup_context ,
rate_limiter_priority , & FullFilterBlockReader : : PrefixesMayMatch ) ;
MayMatch ( range , prefix_extractor , no_io , lookup_context , read_options ,
& FullFilterBlockReader : : PrefixesMayMatch ) ;
}
BlockHandle PartitionedFilterBlockReader : : GetFilterPartitionHandle (
@ -290,8 +288,7 @@ BlockHandle PartitionedFilterBlockReader::GetFilterPartitionHandle(
Status PartitionedFilterBlockReader : : GetFilterPartitionBlock (
FilePrefetchBuffer * prefetch_buffer , const BlockHandle & fltr_blk_handle ,
bool no_io , GetContext * get_context ,
BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ,
BlockCacheLookupContext * lookup_context , const ReadOptions & _read_options ,
CachableEntry < ParsedFullFilterBlock > * filter_block ) const {
assert ( table ( ) ) ;
assert ( filter_block ) ;
@ -307,8 +304,7 @@ Status PartitionedFilterBlockReader::GetFilterPartitionBlock(
}
}
ReadOptions read_options ;
read_options . rate_limiter_priority = rate_limiter_priority ;
ReadOptions read_options = _read_options ;
if ( no_io ) {
read_options . read_tier = kBlockCacheTier ;
}
@ -326,11 +322,10 @@ Status PartitionedFilterBlockReader::GetFilterPartitionBlock(
bool PartitionedFilterBlockReader : : MayMatch (
const Slice & slice , bool no_io , const Slice * const_ikey_ptr ,
GetContext * get_context , BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ,
FilterFunction filter_function ) const {
const ReadOptions & read_options , FilterFunction filter_function ) const {
CachableEntry < Block_kFilterPartitionIndex > filter_block ;
Status s = GetOrReadFilterBlock ( no_io , get_context , lookup_context ,
& filter_block , rate_limiter_priority ) ;
& filter_block , read_options ) ;
if ( UNLIKELY ( ! s . ok ( ) ) ) {
IGNORE_STATUS_IF_ERROR ( s ) ;
return true ;
@ -347,8 +342,8 @@ bool PartitionedFilterBlockReader::MayMatch(
CachableEntry < ParsedFullFilterBlock > filter_partition_block ;
s = GetFilterPartitionBlock ( nullptr /* prefetch_buffer */ , filter_handle ,
no_io , get_context , lookup_context ,
rate_limiter_priority , & filter_partition_block ) ;
no_io , get_context , lookup_context , read_options ,
& filter_partition_block ) ;
if ( UNLIKELY ( ! s . ok ( ) ) ) {
IGNORE_STATUS_IF_ERROR ( s ) ;
return true ;
@ -356,20 +351,17 @@ bool PartitionedFilterBlockReader::MayMatch(
FullFilterBlockReader filter_partition ( table ( ) ,
std : : move ( filter_partition_block ) ) ;
return ( filter_partition . * filter_function ) ( slice , no_io , const_ikey_ptr ,
get_context , lookup_context ,
rate_limiter_priority ) ;
return ( filter_partition . * filter_function ) (
slice , no_io , const_ikey_ptr , get_context , lookup_context , read_options ) ;
}
void PartitionedFilterBlockReader : : MayMatch (
MultiGetRange * range , const SliceTransform * prefix_extractor , bool no_io ,
BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ,
BlockCacheLookupContext * lookup_context , const ReadOptions & read_options ,
FilterManyFunction filter_function ) const {
CachableEntry < Block_kFilterPartitionIndex > filter_block ;
Status s =
GetOrReadFilterBlock ( no_io , range - > begin ( ) - > get_context , lookup_context ,
& filter_block , rate_limiter_priority ) ;
Status s = GetOrReadFilterBlock ( no_io , range - > begin ( ) - > get_context ,
lookup_context , & filter_block , read_options ) ;
if ( UNLIKELY ( ! s . ok ( ) ) ) {
IGNORE_STATUS_IF_ERROR ( s ) ;
return ; // Any/all may match
@ -393,7 +385,7 @@ void PartitionedFilterBlockReader::MayMatch(
this_filter_handle ! = prev_filter_handle ) {
MultiGetRange subrange ( * range , start_iter_same_handle , iter ) ;
MayMatchPartition ( & subrange , prefix_extractor , prev_filter_handle , no_io ,
lookup_context , rate_limiter_priority , filter_function ) ;
lookup_context , read_options , filter_function ) ;
range - > AddSkipsFrom ( subrange ) ;
start_iter_same_handle = iter ;
}
@ -409,7 +401,7 @@ void PartitionedFilterBlockReader::MayMatch(
if ( ! prev_filter_handle . IsNull ( ) ) {
MultiGetRange subrange ( * range , start_iter_same_handle , range - > end ( ) ) ;
MayMatchPartition ( & subrange , prefix_extractor , prev_filter_handle , no_io ,
lookup_context , rate_limiter_priority , filter_function ) ;
lookup_context , read_options , filter_function ) ;
range - > AddSkipsFrom ( subrange ) ;
}
}
@ -417,13 +409,12 @@ void PartitionedFilterBlockReader::MayMatch(
void PartitionedFilterBlockReader : : MayMatchPartition (
MultiGetRange * range , const SliceTransform * prefix_extractor ,
BlockHandle filter_handle , bool no_io ,
BlockCacheLookupContext * lookup_context ,
Env : : IOPriority rate_limiter_priority ,
BlockCacheLookupContext * lookup_context , const ReadOptions & read_options ,
FilterManyFunction filter_function ) const {
CachableEntry < ParsedFullFilterBlock > filter_partition_block ;
Status s = GetFilterPartitionBlock (
nullptr /* prefetch_buffer */ , filter_handle , no_io ,
range - > begin ( ) - > get_context , lookup_context , rate_limiter_priority ,
range - > begin ( ) - > get_context , lookup_context , read_options ,
& filter_partition_block ) ;
if ( UNLIKELY ( ! s . ok ( ) ) ) {
IGNORE_STATUS_IF_ERROR ( s ) ;
@ -433,7 +424,7 @@ void PartitionedFilterBlockReader::MayMatchPartition(
FullFilterBlockReader filter_partition ( table ( ) ,
std : : move ( filter_partition_block ) ) ;
( filter_partition . * filter_function ) ( range , prefix_extractor , no_io ,
lookup_context , rate_limiter_priority ) ;
lookup_context , read_options ) ;
}
size_t PartitionedFilterBlockReader : : ApproximateMemoryUsage ( ) const {
@ -460,8 +451,7 @@ Status PartitionedFilterBlockReader::CacheDependencies(const ReadOptions& ro,
CachableEntry < Block_kFilterPartitionIndex > filter_block ;
Status s = GetOrReadFilterBlock ( false /* no_io */ , nullptr /* get_context */ ,
& lookup_context , & filter_block ,
ro . rate_limiter_priority ) ;
& lookup_context , & filter_block , ro ) ;
if ( ! s . ok ( ) ) {
ROCKS_LOG_ERROR ( rep - > ioptions . logger ,
" Error retrieving top-level filter block while trying to "