OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 106 of file ParquetShared.h.

Member Function Documentation

void foreign_storage::FileReaderMap::clear ( )
inline

Definition at line 131 of file ParquetShared.h.

References map_, and mutex_.

131  {
132  mapd_unique_lock<std::mutex> cache_lock(mutex_);
133  map_.clear();
134  }
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 108 of file ParquetShared.h.

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

Referenced by foreign_storage::RowGroupIntervalTracker::advanceToNextRowGroup(), and foreign_storage::LazyParquetChunkLoader::appendRowGroups().

109  {
110  mapd_unique_lock<std::mutex> cache_lock(mutex_);
111  if (map_.count(path) < 1 || !(map_.at(path))) {
112  map_[path] = open_parquet_table(path, file_system);
113  }
114  return map_.at(path).get();
115  }
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 124 of file ParquetShared.h.

References map_, and mutex_.

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

124  {
125  mapd_unique_lock<std::mutex> cache_lock(mutex_);
126  if (map_.count(path) < 1) {
127  map_.emplace(path, UniqueReaderPtr());
128  }
129  }
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 117 of file ParquetShared.h.

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

Referenced by foreign_storage::LazyParquetChunkLoader::loadRowGroups(), and foreign_storage::LazyParquetChunkLoader::metadataScan().

118  {
119  mapd_unique_lock<std::mutex> cache_lock(mutex_);
120  map_[path] = open_parquet_table(path, file_system);
121  return map_.at(path).get();
122  }
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 138 of file ParquetShared.h.

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

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

Definition at line 137 of file ParquetShared.h.

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


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