@ -2215,11 +2215,13 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
if ( ! read_options . async_io | | ! using_coroutines ( ) | |
fp . GetHitFileLevel ( ) = = 0 | | ! fp . RemainingOverlapInLevel ( ) ) {
if ( f ) {
bool skip_filters = IsFilterSkipped (
static_cast < int > ( fp . GetHitFileLevel ( ) ) , fp . IsHitFileLastInLevel ( ) ) ;
// Call MultiGetFromSST for looking up a single file
s = MultiGetFromSST ( read_options , fp . CurrentFileRange ( ) ,
fp . GetHitFileLevel ( ) , fp . IsHitFileLastInLevel ( ) , f ,
blob_ctxs , num_filter_read , num_index _read,
num_sst_read ) ;
fp . GetHitFileLevel ( ) , skip_filters , f , blob_ctxs ,
/*table_handle=*/ nullptr , num_filter _read,
num_index_read , num_ sst_read ) ;
if ( fp . GetHitFileLevel ( ) = = 0 ) {
dump_stats_for_l0_file = true ;
}
@ -2231,16 +2233,39 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
} else {
std : : vector < folly : : coro : : Task < Status > > mget_tasks ;
while ( f ! = nullptr ) {
mget_tasks . emplace_back ( MultiGetFromSSTCoroutine (
read_options , fp . CurrentFileRange ( ) , fp . GetHitFileLevel ( ) ,
fp . IsHitFileLastInLevel ( ) , f , blob_ctxs , num_filter_read ,
num_index_read , num_sst_read ) ) ;
MultiGetRange file_range = fp . CurrentFileRange ( ) ;
Cache : : Handle * table_handle = nullptr ;
bool skip_filters = IsFilterSkipped (
static_cast < int > ( fp . GetHitFileLevel ( ) ) , fp . IsHitFileLastInLevel ( ) ) ;
if ( ! skip_filters ) {
Status status = table_cache_ - > MultiGetFilter (
read_options , * internal_comparator ( ) , * f - > file_metadata ,
mutable_cf_options_ . prefix_extractor ,
cfd_ - > internal_stats ( ) - > GetFileReadHist ( fp . GetHitFileLevel ( ) ) ,
fp . GetHitFileLevel ( ) , & file_range , & table_handle ) ;
if ( status . ok ( ) ) {
skip_filters = true ;
} else if ( ! status . IsNotSupported ( ) ) {
s = status ;
}
}
if ( ! s . ok ( ) ) {
break ;
}
if ( ! file_range . empty ( ) ) {
mget_tasks . emplace_back ( MultiGetFromSSTCoroutine (
read_options , file_range , fp . GetHitFileLevel ( ) , skip_filters , f ,
blob_ctxs , table_handle , num_filter_read , num_index_read ,
num_sst_read ) ) ;
}
if ( fp . KeyMaySpanNextFile ( ) ) {
break ;
}
f = fp . GetNextFileInLevel ( ) ;
}
if ( mget_tasks . size ( ) > 0 ) {
if ( s . ok ( ) & & mget_tasks . size ( ) > 0 ) {
RecordTick ( db_statistics_ , MULTIGET_COROUTINE_COUNT , mget_tasks . size ( ) ) ;
// Collect all results so far
std : : vector < Status > statuses = folly : : coro : : blockingWait (