OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::ForeignStorageMgr Class Reference

#include <ForeignStorageMgr.h>

+ Inheritance diagram for foreign_storage::ForeignStorageMgr:
+ Collaboration diagram for foreign_storage::ForeignStorageMgr:

Public Types

using ParallelismHint = std::pair< int, int >
 

Public Member Functions

 ForeignStorageMgr ()
 
 ~ForeignStorageMgr () override
 
AbstractBuffercreateBuffer (const ChunkKey &chunk_key, const size_t page_size, const size_t initial_size) override
 
void deleteBuffer (const ChunkKey &chunk_key, const bool purge) override
 
void deleteBuffersWithPrefix (const ChunkKey &chunk_key_prefix, const bool purge) override
 
AbstractBuffergetBuffer (const ChunkKey &chunk_key, const size_t num_bytes) override
 
void fetchBuffer (const ChunkKey &chunk_key, AbstractBuffer *destination_buffer, const size_t num_bytes) override
 
AbstractBufferputBuffer (const ChunkKey &chunk_key, AbstractBuffer *source_buffer, const size_t num_bytes) override
 
void getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunk_metadata, const ChunkKey &chunk_key_prefix) override
 
bool isBufferOnDevice (const ChunkKey &chunk_key) override
 
std::string printSlabs () override
 
size_t getMaxSize () override
 
size_t getInUseSize () override
 
size_t getAllocated () override
 
bool isAllocationCapped () override
 
void checkpoint () override
 
void checkpoint (const int db_id, const int tb_id) override
 
AbstractBufferalloc (const size_t num_bytes) override
 
void free (AbstractBuffer *buffer) override
 
MgrType getMgrType () override
 
std::string getStringMgrType () override
 
size_t getNumChunks () override
 
void removeTableRelatedDS (const int db_id, const int table_id) override
 
bool hasDataWrapperForChunk (const ChunkKey &chunk_key) const
 
virtual bool createDataWrapperIfNotExists (const ChunkKey &chunk_key)
 
bool isDatawrapperRestored (const ChunkKey &chunk_key)
 
void setDataWrapper (const ChunkKey &table_key, std::shared_ptr< MockForeignDataWrapper > data_wrapper)
 
std::shared_ptr
< ForeignDataWrapper
getDataWrapper (const ChunkKey &chunk_key) const
 
virtual void refreshTable (const ChunkKey &table_key, const bool evict_cached_entries)
 
void setParallelismHints (const std::map< ChunkKey, std::set< ParallelismHint >> &hints_per_table)
 
virtual size_t maxFetchSize (int32_t db_id) const
 
virtual bool hasMaxFetchSize () const
 

Protected Member Functions

virtual void eraseDataWrapper (const ChunkKey &table_key)
 
void updateFragmenterMetadata (const ChunkToBufferMap &) const
 
void createDataWrapperUnlocked (int32_t db, int32_t tb)
 
bool fetchBufferIfTempBufferMapEntryExists (const ChunkKey &chunk_key, AbstractBuffer *destination_buffer, const size_t num_bytes)
 
ChunkToBufferMap allocateTempBuffersForChunks (const std::set< ChunkKey > &chunk_keys)
 
void clearTempChunkBufferMapEntriesForTable (const ChunkKey &table_key)
 
void clearTempChunkBufferMapEntriesForTableUnlocked (const ChunkKey &table_key)
 
std::set< ChunkKeygetOptionalChunkKeySetAndNormalizeCache (const ChunkKey &chunk_key, const std::set< ChunkKey > &required_chunk_keys, const ForeignDataWrapper::ParallelismLevel parallelism_level)
 
std::pair< std::set< ChunkKey,
decltype(set_comp)* >
, std::set< ChunkKey, decltype(set_comp)* > > 
getPrefetchSets (const ChunkKey &chunk_key, const std::set< ChunkKey > &required_chunk_keys, const ForeignDataWrapper::ParallelismLevel parallelism_level) const
 
virtual std::set< ChunkKeygetOptionalKeysWithinSizeLimit (const ChunkKey &chunk_key, const std::set< ChunkKey, decltype(set_comp)* > &same_fragment_keys, const std::set< ChunkKey, decltype(set_comp)* > &diff_fragment_keys) const
 
virtual bool isChunkCached (const ChunkKey &chunk_key) const
 
virtual void evictChunkFromCache (const ChunkKey &chunk_key)
 

Static Protected Member Functions

static void checkIfS3NeedsToBeEnabled (const ChunkKey &chunk_key)
 

Protected Attributes

std::shared_mutex data_wrapper_mutex_
 
std::map< ChunkKey,
std::shared_ptr
< ForeignDataWrapper > > 
data_wrapper_map_
 
std::map< ChunkKey,
std::shared_ptr
< MockForeignDataWrapper > > 
mocked_wrapper_map_
 
std::map< ChunkKey,
std::unique_ptr
< AbstractBuffer > > 
temp_chunk_buffer_map_
 
std::shared_mutex temp_chunk_buffer_map_mutex_
 
std::shared_mutex parallelism_hints_mutex_
 
std::map< ChunkKey, std::set
< ParallelismHint > > 
parallelism_hints_per_table_
 

Detailed Description

Definition at line 78 of file ForeignStorageMgr.h.

Member Typedef Documentation

Definition at line 128 of file ForeignStorageMgr.h.

Constructor & Destructor Documentation

foreign_storage::ForeignStorageMgr::ForeignStorageMgr ( )

Definition at line 43 of file ForeignStorageMgr.cpp.

43 : AbstractBufferMgr(0), data_wrapper_map_({}) {}
std::map< ChunkKey, std::shared_ptr< ForeignDataWrapper > > data_wrapper_map_
foreign_storage::ForeignStorageMgr::~ForeignStorageMgr ( )
inlineoverride

Definition at line 82 of file ForeignStorageMgr.h.

82 {}

Member Function Documentation

AbstractBuffer* foreign_storage::ForeignStorageMgr::alloc ( const size_t  num_bytes)
override
ChunkToBufferMap foreign_storage::ForeignStorageMgr::allocateTempBuffersForChunks ( const std::set< ChunkKey > &  chunk_keys)
protected
static void foreign_storage::ForeignStorageMgr::checkIfS3NeedsToBeEnabled ( const ChunkKey chunk_key)
staticprotected

Referenced by foreign_storage::CachingForeignStorageMgr::refreshTable().

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageMgr::checkpoint ( )
override
void foreign_storage::ForeignStorageMgr::checkpoint ( const int  db_id,
const int  tb_id 
)
override
void foreign_storage::ForeignStorageMgr::clearTempChunkBufferMapEntriesForTable ( const ChunkKey table_key)
protected

Referenced by foreign_storage::CachingForeignStorageMgr::refreshTable().

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageMgr::clearTempChunkBufferMapEntriesForTableUnlocked ( const ChunkKey table_key)
protected
AbstractBuffer* foreign_storage::ForeignStorageMgr::createBuffer ( const ChunkKey chunk_key,
const size_t  page_size,
const size_t  initial_size 
)
override
virtual bool foreign_storage::ForeignStorageMgr::createDataWrapperIfNotExists ( const ChunkKey chunk_key)
virtual
void foreign_storage::ForeignStorageMgr::createDataWrapperUnlocked ( int32_t  db,
int32_t  tb 
)
protected

Referenced by foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists().

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageMgr::deleteBuffer ( const ChunkKey chunk_key,
const bool  purge 
)
override
void foreign_storage::ForeignStorageMgr::deleteBuffersWithPrefix ( const ChunkKey chunk_key_prefix,
const bool  purge 
)
override
virtual void foreign_storage::ForeignStorageMgr::eraseDataWrapper ( const ChunkKey table_key)
protectedvirtual

Reimplemented in foreign_storage::CachingForeignStorageMgr.

Referenced by foreign_storage::CachingForeignStorageMgr::clearTable().

+ Here is the caller graph for this function:

virtual void foreign_storage::ForeignStorageMgr::evictChunkFromCache ( const ChunkKey chunk_key)
protectedvirtual
void foreign_storage::ForeignStorageMgr::fetchBuffer ( const ChunkKey chunk_key,
AbstractBuffer destination_buffer,
const size_t  num_bytes 
)
override

Referenced by foreign_storage::CachingForeignStorageMgr::fetchBuffer().

+ Here is the caller graph for this function:

bool foreign_storage::ForeignStorageMgr::fetchBufferIfTempBufferMapEntryExists ( const ChunkKey chunk_key,
AbstractBuffer destination_buffer,
const size_t  num_bytes 
)
protected
void foreign_storage::ForeignStorageMgr::free ( AbstractBuffer buffer)
override
size_t foreign_storage::ForeignStorageMgr::getAllocated ( )
override
AbstractBuffer* foreign_storage::ForeignStorageMgr::getBuffer ( const ChunkKey chunk_key,
const size_t  num_bytes 
)
override
void foreign_storage::ForeignStorageMgr::getChunkMetadataVecForKeyPrefix ( ChunkMetadataVector chunk_metadata,
const ChunkKey chunk_key_prefix 
)
override

Referenced by foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper().

+ Here is the caller graph for this function:

std::shared_ptr<ForeignDataWrapper> foreign_storage::ForeignStorageMgr::getDataWrapper ( const ChunkKey chunk_key) const

Referenced by foreign_storage::CachingForeignStorageMgr::fetchBuffer(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

+ Here is the caller graph for this function:

size_t foreign_storage::ForeignStorageMgr::getInUseSize ( )
override
size_t foreign_storage::ForeignStorageMgr::getMaxSize ( )
override
MgrType foreign_storage::ForeignStorageMgr::getMgrType ( )
override
size_t foreign_storage::ForeignStorageMgr::getNumChunks ( )
override
std::set<ChunkKey> foreign_storage::ForeignStorageMgr::getOptionalChunkKeySetAndNormalizeCache ( const ChunkKey chunk_key,
const std::set< ChunkKey > &  required_chunk_keys,
const ForeignDataWrapper::ParallelismLevel  parallelism_level 
)
protected

Referenced by foreign_storage::CachingForeignStorageMgr::fetchBuffer().

+ Here is the caller graph for this function:

virtual std::set<ChunkKey> foreign_storage::ForeignStorageMgr::getOptionalKeysWithinSizeLimit ( const ChunkKey chunk_key,
const std::set< ChunkKey, decltype(set_comp)* > &  same_fragment_keys,
const std::set< ChunkKey, decltype(set_comp)* > &  diff_fragment_keys 
) const
protectedvirtual
std::pair<std::set<ChunkKey, decltype(set_comp)*>, std::set<ChunkKey, decltype(set_comp)*> > foreign_storage::ForeignStorageMgr::getPrefetchSets ( const ChunkKey chunk_key,
const std::set< ChunkKey > &  required_chunk_keys,
const ForeignDataWrapper::ParallelismLevel  parallelism_level 
) const
protected
std::string foreign_storage::ForeignStorageMgr::getStringMgrType ( )
override
bool foreign_storage::ForeignStorageMgr::hasDataWrapperForChunk ( const ChunkKey chunk_key) const
virtual bool foreign_storage::ForeignStorageMgr::hasMaxFetchSize ( ) const
virtual
bool foreign_storage::ForeignStorageMgr::isAllocationCapped ( )
override
bool foreign_storage::ForeignStorageMgr::isBufferOnDevice ( const ChunkKey chunk_key)
override
virtual bool foreign_storage::ForeignStorageMgr::isChunkCached ( const ChunkKey chunk_key) const
protectedvirtual
bool foreign_storage::ForeignStorageMgr::isDatawrapperRestored ( const ChunkKey chunk_key)
virtual size_t foreign_storage::ForeignStorageMgr::maxFetchSize ( int32_t  db_id) const
virtual
std::string foreign_storage::ForeignStorageMgr::printSlabs ( )
override
AbstractBuffer* foreign_storage::ForeignStorageMgr::putBuffer ( const ChunkKey chunk_key,
AbstractBuffer source_buffer,
const size_t  num_bytes 
)
override
virtual void foreign_storage::ForeignStorageMgr::refreshTable ( const ChunkKey table_key,
const bool  evict_cached_entries 
)
virtual
void foreign_storage::ForeignStorageMgr::removeTableRelatedDS ( const int  db_id,
const int  table_id 
)
override

Referenced by foreign_storage::CachingForeignStorageMgr::removeTableRelatedDS().

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageMgr::setDataWrapper ( const ChunkKey table_key,
std::shared_ptr< MockForeignDataWrapper data_wrapper 
)
void foreign_storage::ForeignStorageMgr::setParallelismHints ( const std::map< ChunkKey, std::set< ParallelismHint >> &  hints_per_table)
void foreign_storage::ForeignStorageMgr::updateFragmenterMetadata ( const ChunkToBufferMap ) const
protected

Referenced by foreign_storage::CachingForeignStorageMgr::populateChunkBuffersSafely().

+ Here is the caller graph for this function:

Member Data Documentation

std::map<ChunkKey, std::shared_ptr<ForeignDataWrapper> > foreign_storage::ForeignStorageMgr::data_wrapper_map_
protected
std::shared_mutex foreign_storage::ForeignStorageMgr::data_wrapper_mutex_
mutableprotected
std::map<ChunkKey, std::shared_ptr<MockForeignDataWrapper> > foreign_storage::ForeignStorageMgr::mocked_wrapper_map_
protected

Definition at line 173 of file ForeignStorageMgr.h.

std::shared_mutex foreign_storage::ForeignStorageMgr::parallelism_hints_mutex_
mutableprotected

Definition at line 180 of file ForeignStorageMgr.h.

std::map<ChunkKey, std::set<ParallelismHint> > foreign_storage::ForeignStorageMgr::parallelism_hints_per_table_
protected

Definition at line 181 of file ForeignStorageMgr.h.

std::map<ChunkKey, std::unique_ptr<AbstractBuffer> > foreign_storage::ForeignStorageMgr::temp_chunk_buffer_map_
protected

Definition at line 177 of file ForeignStorageMgr.h.

std::shared_mutex foreign_storage::ForeignStorageMgr::temp_chunk_buffer_map_mutex_
mutableprotected

Definition at line 178 of file ForeignStorageMgr.h.


The documentation for this class was generated from the following files: