@ -103,7 +103,7 @@ Status TableCache::GetTableReader(
std : : unique_ptr < TableReader > * table_reader ,
std : : unique_ptr < TableReader > * table_reader ,
const SliceTransform * prefix_extractor , bool skip_filters , int level ,
const SliceTransform * prefix_extractor , bool skip_filters , int level ,
bool prefetch_index_and_filter_in_cache ,
bool prefetch_index_and_filter_in_cache ,
size_t max_file_size_for_l0_meta_pin ) {
size_t max_file_size_for_l0_meta_pin , Temperature file_temperature ) {
std : : string fname =
std : : string fname =
TableFileName ( ioptions_ . cf_paths , fd . GetNumber ( ) , fd . GetPathId ( ) ) ;
TableFileName ( ioptions_ . cf_paths , fd . GetNumber ( ) , fd . GetPathId ( ) ) ;
std : : unique_ptr < FSRandomAccessFile > file ;
std : : unique_ptr < FSRandomAccessFile > file ;
@ -132,7 +132,8 @@ Status TableCache::GetTableReader(
new RandomAccessFileReader (
new RandomAccessFileReader (
std : : move ( file ) , fname , ioptions_ . clock , io_tracer_ ,
std : : move ( file ) , fname , ioptions_ . clock , io_tracer_ ,
record_read_stats ? ioptions_ . stats : nullptr , SST_READ_MICROS ,
record_read_stats ? ioptions_ . stats : nullptr , SST_READ_MICROS ,
file_read_hist , ioptions_ . rate_limiter . get ( ) , ioptions_ . listeners ) ) ;
file_read_hist , ioptions_ . rate_limiter . get ( ) , ioptions_ . listeners ,
file_temperature ) ) ;
s = ioptions_ . table_factory - > NewTableReader (
s = ioptions_ . table_factory - > NewTableReader (
ro ,
ro ,
TableReaderOptions (
TableReaderOptions (
@ -154,15 +155,13 @@ void TableCache::EraseHandle(const FileDescriptor& fd, Cache::Handle* handle) {
cache_ - > Erase ( key ) ;
cache_ - > Erase ( key ) ;
}
}
Status TableCache : : FindTable ( const ReadOptions & ro ,
Status TableCache : : FindTable (
const FileOptions & file_options ,
const ReadOptions & ro , const FileOptions & file_options ,
const InternalKeyComparator & internal_comparator ,
const InternalKeyComparator & internal_comparator , const FileDescriptor & fd ,
const FileDescriptor & fd , Cache : : Handle * * handle ,
Cache : : Handle * * handle , const SliceTransform * prefix_extractor ,
const SliceTransform * prefix_extractor ,
const bool no_io , bool record_read_stats , HistogramImpl * file_read_hist ,
const bool no_io , bool record_read_stats ,
bool skip_filters , int level , bool prefetch_index_and_filter_in_cache ,
HistogramImpl * file_read_hist , bool skip_filters ,
size_t max_file_size_for_l0_meta_pin , Temperature file_temperature ) {
int level , bool prefetch_index_and_filter_in_cache ,
size_t max_file_size_for_l0_meta_pin ) {
PERF_TIMER_GUARD_WITH_CLOCK ( find_table_nanos , ioptions_ . clock ) ;
PERF_TIMER_GUARD_WITH_CLOCK ( find_table_nanos , ioptions_ . clock ) ;
uint64_t number = fd . GetNumber ( ) ;
uint64_t number = fd . GetNumber ( ) ;
Slice key = GetSliceForFileNumber ( & number ) ;
Slice key = GetSliceForFileNumber ( & number ) ;
@ -186,7 +185,7 @@ Status TableCache::FindTable(const ReadOptions& ro,
ro , file_options , internal_comparator , fd , false /* sequential mode */ ,
ro , file_options , internal_comparator , fd , false /* sequential mode */ ,
record_read_stats , file_read_hist , & table_reader , prefix_extractor ,
record_read_stats , file_read_hist , & table_reader , prefix_extractor ,
skip_filters , level , prefetch_index_and_filter_in_cache ,
skip_filters , level , prefetch_index_and_filter_in_cache ,
max_file_size_for_l0_meta_pin ) ;
max_file_size_for_l0_meta_pin , file_temperature ) ;
if ( ! s . ok ( ) ) {
if ( ! s . ok ( ) ) {
assert ( table_reader = = nullptr ) ;
assert ( table_reader = = nullptr ) ;
RecordTick ( ioptions_ . stats , NO_FILE_ERRORS ) ;
RecordTick ( ioptions_ . stats , NO_FILE_ERRORS ) ;
@ -231,7 +230,7 @@ InternalIterator* TableCache::NewIterator(
options . read_tier = = kBlockCacheTier /* no_io */ ,
options . read_tier = = kBlockCacheTier /* no_io */ ,
! for_compaction /* record_read_stats */ , file_read_hist , skip_filters ,
! for_compaction /* record_read_stats */ , file_read_hist , skip_filters ,
level , true /* prefetch_index_and_filter_in_cache */ ,
level , true /* prefetch_index_and_filter_in_cache */ ,
max_file_size_for_l0_meta_pin ) ;
max_file_size_for_l0_meta_pin , file_meta . temperature ) ;
if ( s . ok ( ) ) {
if ( s . ok ( ) ) {
table_reader = GetTableReaderFromHandle ( handle ) ;
table_reader = GetTableReaderFromHandle ( handle ) ;
}
}
@ -431,7 +430,7 @@ Status TableCache::Get(const ReadOptions& options,
options . read_tier = = kBlockCacheTier /* no_io */ ,
options . read_tier = = kBlockCacheTier /* no_io */ ,
true /* record_read_stats */ , file_read_hist , skip_filters ,
true /* record_read_stats */ , file_read_hist , skip_filters ,
level , true /* prefetch_index_and_filter_in_cache */ ,
level , true /* prefetch_index_and_filter_in_cache */ ,
max_file_size_for_l0_meta_pin ) ;
max_file_size_for_l0_meta_pin , file_meta . temperature ) ;
if ( s . ok ( ) ) {
if ( s . ok ( ) ) {
t = GetTableReaderFromHandle ( handle ) ;
t = GetTableReaderFromHandle ( handle ) ;
}
}
@ -531,10 +530,12 @@ Status TableCache::MultiGet(const ReadOptions& options,
// found in the row cache and thus the range may now be empty
// found in the row cache and thus the range may now be empty
if ( s . ok ( ) & & ! table_range . empty ( ) ) {
if ( s . ok ( ) & & ! table_range . empty ( ) ) {
if ( t = = nullptr ) {
if ( t = = nullptr ) {
s = FindTable (
s = FindTable ( options , file_options_ , internal_comparator , fd , & handle ,
options , file_options_ , internal_comparator , fd , & handle ,
prefix_extractor ,
prefix_extractor , options . read_tier = = kBlockCacheTier /* no_io */ ,
options . read_tier = = kBlockCacheTier /* no_io */ ,
true /* record_read_stats */ , file_read_hist , skip_filters , level ) ;
true /* record_read_stats */ , file_read_hist , skip_filters ,
level , true /* prefetch_index_and_filter_in_cache */ ,
0 /*max_file_size_for_l0_meta_pin*/ , file_meta . temperature ) ;
TEST_SYNC_POINT_CALLBACK ( " TableCache::MultiGet:FindTable " , & s ) ;
TEST_SYNC_POINT_CALLBACK ( " TableCache::MultiGet:FindTable " , & s ) ;
if ( s . ok ( ) ) {
if ( s . ok ( ) ) {
t = GetTableReaderFromHandle ( handle ) ;
t = GetTableReaderFromHandle ( handle ) ;