OmniSciDB  a5dc49c757
 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 68 of file ParquetShared.h.

Member Function Documentation

void foreign_storage::FileReaderMap::clear ( )
inline

Definition at line 93 of file ParquetShared.h.

References map_, and mutex_.

93  {
95  map_.clear();
96  }
std::unique_lock< T > unique_lock
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 70 of file ParquetShared.h.

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

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

71  {
73  if (map_.count(path) < 1 || !(map_.at(path))) {
74  map_[path] = open_parquet_table(path, file_system);
75  }
76  return map_.at(path).get();
77  }
UniqueReaderPtr open_parquet_table(const std::string &file_path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
std::unique_lock< T > unique_lock
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 86 of file ParquetShared.h.

References map_, and mutex_.

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

86  {
88  if (map_.count(path) < 1) {
89  map_.emplace(path, UniqueReaderPtr());
90  }
91  }
std::unique_lock< T > unique_lock
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 79 of file ParquetShared.h.

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

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

80  {
82  map_[path] = open_parquet_table(path, file_system);
83  return map_.at(path).get();
84  }
UniqueReaderPtr open_parquet_table(const std::string &file_path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
std::unique_lock< T > unique_lock
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 100 of file ParquetShared.h.

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

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

Definition at line 99 of file ParquetShared.h.

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


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