• S
    [Performance Branch] If options.max_open_files set to be -1, cache table... · aa0ef660
    Siying Dong 提交于
    [Performance Branch] If options.max_open_files set to be -1, cache table readers in FileMetadata for Get() and NewIterator()
    
    Summary:
    In some use cases, table readers for all live files should always be cached. In that case, there will be an opportunity to avoid the table cache look-up while Get() and NewIterator().
    
    We define options.max_open_files = -1 to be the mode that table readers for live files will always be kept. In that mode, table readers are cached in FileMetaData (with a reference count hold in table cache). So that when executing table_cache.Get() and table_cache.newInterator(), LRU cache checking can be by-passed, to reduce latency.
    
    Test Plan: add a test case in db_test
    
    Reviewers: haobo, kailiu
    
    Reviewed By: haobo
    
    CC: dhruba, igor, leveldb
    
    Differential Revision: https://reviews.facebook.net/D15039
    aa0ef660
version_set.cc 106.0 KB