OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::FileReaderMap Class Reference

#include <ParquetShared.h>

Public Member Functions

const ReaderPtr getOrInsert (const std::string &path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
 
const ReaderPtr insert (const std::string &path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
 
void initializeIfEmpty (const std::string &path)
 
void clear ()
 

Private Attributes

std::mutex mutex_
 
std::map< const std::string,
UniqueReaderPtr
map_
 

Detailed Description

Definition at line 87 of file ParquetShared.h.

Member Function Documentation

void foreign_storage::FileReaderMap::clear ( )
inline

Definition at line 112 of file ParquetShared.h.

References map_, and mutex_.

112  {
113  mapd_unique_lock<std::mutex> cache_lock(mutex_);
114  map_.clear();
115  }
std::map< const std::string, UniqueReaderPtr > map_
const ReaderPtr foreign_storage::FileReaderMap::getOrInsert ( const std::string &  path,
std::shared_ptr< arrow::fs::FileSystem > &  file_system 
)
inline

Definition at line 89 of file ParquetShared.h.

References map_, mutex_, and foreign_storage::open_parquet_table().

Referenced by foreign_storage::LazyParquetChunkLoader::appendRowGroups().

90  {
91  mapd_unique_lock<std::mutex> cache_lock(mutex_);
92  if (map_.count(path) < 1 || !(map_.at(path))) {
93  map_[path] = open_parquet_table(path, file_system);
94  }
95  return map_.at(path).get();
96  }
UniqueReaderPtr open_parquet_table(const std::string &file_path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
std::map< const std::string, UniqueReaderPtr > map_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::FileReaderMap::initializeIfEmpty ( const std::string &  path)
inline

Definition at line 105 of file ParquetShared.h.

References map_, and mutex_.

Referenced by foreign_storage::LazyParquetChunkLoader::metadataScan().

105  {
106  mapd_unique_lock<std::mutex> cache_lock(mutex_);
107  if (map_.count(path) < 1) {
108  map_.emplace(path, UniqueReaderPtr());
109  }
110  }
std::map< const std::string, UniqueReaderPtr > map_
std::unique_ptr< parquet::arrow::FileReader > UniqueReaderPtr
Definition: ParquetShared.h:32

+ Here is the caller graph for this function:

const ReaderPtr foreign_storage::FileReaderMap::insert ( const std::string &  path,
std::shared_ptr< arrow::fs::FileSystem > &  file_system 
)
inline

Definition at line 98 of file ParquetShared.h.

References map_, mutex_, and foreign_storage::open_parquet_table().

Referenced by foreign_storage::LazyParquetChunkLoader::metadataScan().

99  {
100  mapd_unique_lock<std::mutex> cache_lock(mutex_);
101  map_[path] = open_parquet_table(path, file_system);
102  return map_.at(path).get();
103  }
UniqueReaderPtr open_parquet_table(const std::string &file_path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
std::map< const std::string, UniqueReaderPtr > map_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::map<const std::string, UniqueReaderPtr> foreign_storage::FileReaderMap::map_
private

Definition at line 119 of file ParquetShared.h.

Referenced by clear(), getOrInsert(), initializeIfEmpty(), and insert().

std::mutex foreign_storage::FileReaderMap::mutex_
mutableprivate

Definition at line 118 of file ParquetShared.h.

Referenced by clear(), getOrInsert(), initializeIfEmpty(), and insert().


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