28 #include "../Shared/mapd_shared_mutex.h"
53 using namespace Data_Namespace;
55 namespace foreign_storage {
71 void cacheTableChunks(
const std::vector<ChunkKey>& chunk_keys);
75 bool isMetadataCached(
const ChunkKey&)
const;
78 bool hasCachedMetadataForKeyPrefix(
const ChunkKey&)
const;
79 void clearForTablePrefix(
const ChunkKey&);
81 std::vector<ChunkKey> getCachedChunksForKeyPrefix(
const ChunkKey&)
const;
84 const std::vector<ChunkKey>& chunk_keys)
const;
90 void deleteBufferIfExists(
const ChunkKey& chunk_key);
98 std::string dumpCachedChunkEntries()
const;
99 std::string dumpCachedMetadataEntries()
const;
102 return caching_file_mgr_->getFileMgrBasePath();
106 return caching_file_mgr_->getOrAddTableDir(db_id, tb_id);
111 void evictThenEraseChunk(
const ChunkKey&);
114 return caching_file_mgr_->getSpaceReservedByTable(db_id, tb_id);
119 std::set<ChunkKey>::iterator eraseChunk(
const std::set<ChunkKey>::iterator&);
120 void eraseChunk(
const ChunkKey& chunk_key);
121 std::set<ChunkKey>::iterator evictChunkByIterator(
122 const std::set<ChunkKey>::iterator& chunk_it);
123 void evictThenEraseChunkUnlocked(
const ChunkKey&);
124 void validatePath(
const std::string&)
const;
DiskCacheLevel enabled_level
std::vector< int > ChunkKey
std::set< ChunkKey > cached_chunks_
bool isEnabledForMutableTables() const
std::map< ChunkKey, AbstractBuffer * > ChunkToBufferMap
uint64_t getSpaceReservedByTable(int db_id, int tb_id) const
size_t getNumChunksAdded() const
std::shared_timed_mutex mapd_shared_mutex
bool isEnabledForFSI() const
const std::string wrapper_file_name
An AbstractBuffer is a unit of data management for a data manager.
size_t getNumCachedMetadata() const
CacheTooSmallException(const std::string &msg)
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
mapd_shared_mutex metadata_mutex_
std::string getCacheDirectory() const
std::string getCacheDirectoryForTable(int db_id, int tb_id) const
size_t getNumMetadataAdded() const
size_t getNumCachedChunks() const
size_t num_reader_threads
mapd_shared_mutex chunks_mutex_
std::set< ChunkKey > cached_metadata_
size_t num_metadata_added_