@ -412,8 +412,8 @@ size_t PartitionedFilterBlockReader::ApproximateMemoryUsage() const {
}
// TODO(myabandeh): merge this with the same function in IndexReader
void PartitionedFilterBlockReader : : CacheDependencies ( const ReadOptions & ro ,
bool pin ) {
Status PartitionedFilterBlockReader : : CacheDependencies ( const ReadOptions & ro ,
bool pin ) {
assert ( table ( ) ) ;
const BlockBasedTable : : Rep * const rep = table ( ) - > get_rep ( ) ;
@ -426,12 +426,11 @@ void PartitionedFilterBlockReader::CacheDependencies(const ReadOptions& ro,
Status s = GetOrReadFilterBlock ( false /* no_io */ , nullptr /* get_context */ ,
& lookup_context , & filter_block ) ;
if ( ! s . ok ( ) ) {
ROCKS_LOG_WARN ( rep - > ioptions . info_log ,
" Error retrieving top-level filter block while trying to "
" cache filter partitions: %s " ,
s . ToString ( ) . c_str ( ) ) ;
IGNORE_STATUS_IF_ERROR ( s ) ;
return ;
ROCKS_LOG_ERROR ( rep - > ioptions . info_log ,
" Error retrieving top-level filter block while trying to "
" cache filter partitions: %s " ,
s . ToString ( ) . c_str ( ) ) ;
return s ;
}
// Before read partitions, prefetch them to avoid lots of IOs
@ -465,6 +464,9 @@ void PartitionedFilterBlockReader::CacheDependencies(const ReadOptions& ro,
s = prefetch_buffer - > Prefetch ( opts , rep - > file . get ( ) , prefetch_off ,
static_cast < size_t > ( prefetch_len ) ) ;
}
if ( ! s . ok ( ) ) {
return s ;
}
// After prefetch, read the partitions one by one
for ( biter . SeekToFirst ( ) ; biter . Valid ( ) ; biter . Next ( ) ) {
@ -477,17 +479,20 @@ void PartitionedFilterBlockReader::CacheDependencies(const ReadOptions& ro,
prefetch_buffer . get ( ) , ro , handle , UncompressionDict : : GetEmptyDict ( ) ,
& block , BlockType : : kFilter , nullptr /* get_context */ , & lookup_context ,
nullptr /* contents */ ) ;
if ( ! s . ok ( ) ) {
return s ;
}
assert ( s . ok ( ) | | block . GetValue ( ) = = nullptr ) ;
if ( s . ok ( ) & & block . GetValue ( ) ! = nullptr ) {
if ( block . GetValue ( ) ! = nullptr ) {
if ( block . IsCached ( ) ) {
if ( pin ) {
filter_map_ [ handle . offset ( ) ] = std : : move ( block ) ;
}
}
}
IGNORE_STATUS_IF_ERROR ( s ) ;
}
return biter . status ( ) ;
}
const InternalKeyComparator * PartitionedFilterBlockReader : : internal_comparator ( )