OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
File_Namespace::GlobalFileMgr Class Reference

#include <GlobalFileMgr.h>

+ Inheritance diagram for File_Namespace::GlobalFileMgr:
+ Collaboration diagram for File_Namespace::GlobalFileMgr:

Public Member Functions

 GlobalFileMgr (const int deviceId, std::string basePath=".", const size_t num_reader_threads=0, const size_t defaultPageSize=2097152)
 Constructor. More...
 
AbstractBuffercreateBuffer (const ChunkKey &key, size_t pageSize=0, const size_t numBytes=0) override
 Creates a chunk with the specified key and page size. More...
 
bool isBufferOnDevice (const ChunkKey &key) override
 
void deleteBuffer (const ChunkKey &key, const bool purge=true) override
 Deletes the chunk with the specified key. More...
 
void deleteBuffersWithPrefix (const ChunkKey &keyPrefix, const bool purge=true) override
 
AbstractBuffergetBuffer (const ChunkKey &key, const size_t numBytes=0) override
 Returns the a pointer to the chunk with the specified key. More...
 
void fetchBuffer (const ChunkKey &key, AbstractBuffer *destBuffer, const size_t numBytes) override
 
AbstractBufferputBuffer (const ChunkKey &key, AbstractBuffer *d, const size_t numBytes=0) override
 Puts the contents of d into the Chunk with the given key. More...
 
AbstractBufferalloc (const size_t numBytes) override
 
void free (AbstractBuffer *buffer) override
 
MgrType getMgrType () override
 
std::string getStringMgrType () override
 
std::string printSlabs () override
 
void clearSlabs () override
 
size_t getMaxSize () override
 
size_t getInUseSize () override
 
size_t getAllocated () override
 
bool isAllocationCapped () override
 
void init ()
 
void getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunkMetadataVec, const ChunkKey &keyPrefix) override
 
void checkpoint () override
 Fsyncs data files, writes out epoch and fsyncs that. More...
 
void checkpoint (const int db_id, const int tb_id) override
 
size_t getNumReaderThreads ()
 Returns number of threads defined by parameter num-reader-threads which should be used during initial load and consequent read of data. More...
 
size_t getNumChunks () override
 
AbstractBufferMgrgetFileMgr (const int db_id, const int tb_id)
 
AbstractBufferMgrgetFileMgr (const ChunkKey &key)
 
std::string getBasePath () const
 
size_t getDefaultPageSize () const
 
void writeFileMgrData (FileMgr *fileMgr=0)
 
int getDBVersion () const
 
bool getDBConvert () const
 
void setDBConvert (bool val)
 
void removeTableRelatedDS (const int db_id, const int tb_id) override
 
void setTableEpoch (const int db_id, const int tb_id, const int start_epoch)
 
size_t getTableEpoch (const int db_id, const int tb_id)
 
std::shared_ptr< FileMgrgetSharedFileMgr (const int db_id, const int table_id)
 
void setFileMgr (const int db_id, const int table_id, std::shared_ptr< FileMgr > file_mgr)
 

Private Member Functions

AbstractBufferMgrfindFileMgr (const int db_id, const int tb_id)
 
void deleteFileMgr (const int db_id, const int tb_id)
 

Private Attributes

std::string basePath_
 
size_t num_reader_threads_
 The OS file system path containing the files. More...
 
int epoch_
 number of threads used when loading data More...
 
size_t defaultPageSize_
 
int mapd_db_version_
 default page size, used to set FileMgr defaultPageSize_ More...
 
bool dbConvert_
 
std::map< std::pair< int, int >
, std::shared_ptr< FileMgr > > 
ownedFileMgrs_
 
std::map< std::pair< int, int >
, AbstractBufferMgr * > 
allFileMgrs_
 
mapd_shared_mutex fileMgrs_mutex_
 

Detailed Description

Definition at line 47 of file GlobalFileMgr.h.

Constructor & Destructor Documentation

File_Namespace::GlobalFileMgr::GlobalFileMgr ( const int  deviceId,
std::string  basePath = ".",
const size_t  num_reader_threads = 0,
const size_t  defaultPageSize = 2097152 
)

Constructor.

Definition at line 41 of file GlobalFileMgr.cpp.

References dbConvert_, init(), and mapd_db_version_.

45  : AbstractBufferMgr(deviceId)
46  , basePath_(basePath)
47  , num_reader_threads_(num_reader_threads)
48  , epoch_(-1)
49  , // set the default epoch for all tables corresponding to the time of
50  // last checkpoint
51  defaultPageSize_(defaultPageSize) {
53  1; // DS changes triggered by individual FileMgr per table project (release 2.1.0)
54  dbConvert_ = false;
55  init();
56 }
int epoch_
number of threads used when loading data
int mapd_db_version_
default page size, used to set FileMgr defaultPageSize_
size_t num_reader_threads_
The OS file system path containing the files.

+ Here is the call graph for this function:

Member Function Documentation

AbstractBuffer* File_Namespace::GlobalFileMgr::alloc ( const size_t  numBytes)
inlineoverride

Definition at line 102 of file GlobalFileMgr.h.

References logger::FATAL, and LOG.

102  {
103  LOG(FATAL) << "Operation not supported";
104  return nullptr; // satisfy return-type warning
105  }
#define LOG(tag)
Definition: Logger.h:188
void File_Namespace::GlobalFileMgr::checkpoint ( )
override

Fsyncs data files, writes out epoch and fsyncs that.

Definition at line 75 of file GlobalFileMgr.cpp.

References allFileMgrs_, and fileMgrs_mutex_.

75  {
76  mapd_unique_lock<mapd_shared_mutex> write_lock(fileMgrs_mutex_);
77  for (auto fileMgrsIt = allFileMgrs_.begin(); fileMgrsIt != allFileMgrs_.end();
78  ++fileMgrsIt) {
79  fileMgrsIt->second->checkpoint();
80  }
81 }
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_
mapd_shared_mutex fileMgrs_mutex_
mapd_unique_lock< mapd_shared_mutex > write_lock
void File_Namespace::GlobalFileMgr::checkpoint ( const int  db_id,
const int  tb_id 
)
override

Definition at line 83 of file GlobalFileMgr.cpp.

References getFileMgr().

83  {
84  getFileMgr(db_id, tb_id)->checkpoint();
85 }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)

+ Here is the call graph for this function:

void File_Namespace::GlobalFileMgr::clearSlabs ( )
inlineoverride

Definition at line 112 of file GlobalFileMgr.h.

112  { /* noop */
113  }
AbstractBuffer* File_Namespace::GlobalFileMgr::createBuffer ( const ChunkKey key,
size_t  pageSize = 0,
const size_t  numBytes = 0 
)
inlineoverride

Creates a chunk with the specified key and page size.

Definition at line 57 of file GlobalFileMgr.h.

59  {
60  return getFileMgr(key)->createBuffer(key, pageSize, numBytes);
61  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
void File_Namespace::GlobalFileMgr::deleteBuffer ( const ChunkKey key,
const bool  purge = true 
)
inlineoverride

Deletes the chunk with the specified key.

Definition at line 71 of file GlobalFileMgr.h.

71  {
72  return getFileMgr(key)->deleteBuffer(key, purge);
73  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
void File_Namespace::GlobalFileMgr::deleteBuffersWithPrefix ( const ChunkKey keyPrefix,
const bool  purge = true 
)
override

Definition at line 98 of file GlobalFileMgr.cpp.

References getFileMgr().

98  {
99  /* keyPrefix[0] can be -1 only for gpu or cpu buffers but not for FileMgr.
100  * There is no assert here, as GlobalFileMgr is being called with -1 value as well in
101  * the same loop with other buffers. So the case of -1 will just be ignored, as nothing
102  * needs to be done.
103  */
104  if (keyPrefix[0] != -1) {
105  return getFileMgr(keyPrefix)->deleteBuffersWithPrefix(keyPrefix, purge);
106  }
107 }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)

+ Here is the call graph for this function:

void File_Namespace::GlobalFileMgr::deleteFileMgr ( const int  db_id,
const int  tb_id 
)
private

Definition at line 119 of file GlobalFileMgr.cpp.

References allFileMgrs_, and ownedFileMgrs_.

Referenced by removeTableRelatedDS(), and setTableEpoch().

119  {
120  // NOTE: only call this private function after locking is already in place
121  const auto file_mgr_key = std::make_pair(db_id, tb_id);
122  if (auto it = ownedFileMgrs_.find(file_mgr_key); it != ownedFileMgrs_.end()) {
123  ownedFileMgrs_.erase(it);
124  }
125  if (auto it = allFileMgrs_.find(file_mgr_key); it != allFileMgrs_.end()) {
126  allFileMgrs_.erase(it);
127  }
128 }
std::map< std::pair< int, int >, std::shared_ptr< FileMgr > > ownedFileMgrs_
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_

+ Here is the caller graph for this function:

void File_Namespace::GlobalFileMgr::fetchBuffer ( const ChunkKey key,
AbstractBuffer destBuffer,
const size_t  numBytes 
)
inlineoverride

Definition at line 83 of file GlobalFileMgr.h.

85  {
86  return getFileMgr(key)->fetchBuffer(key, destBuffer, numBytes);
87  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
AbstractBufferMgr * File_Namespace::GlobalFileMgr::findFileMgr ( const int  db_id,
const int  tb_id 
)
private

Definition at line 109 of file GlobalFileMgr.cpp.

References allFileMgrs_.

Referenced by getFileMgr(), and removeTableRelatedDS().

109  {
110  // NOTE: only call this private function after locking is already in place
111  AbstractBufferMgr* fm = nullptr;
112  const auto file_mgr_key = std::make_pair(db_id, tb_id);
113  if (auto it = allFileMgrs_.find(file_mgr_key); it != allFileMgrs_.end()) {
114  fm = it->second;
115  }
116  return fm;
117 }
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_

+ Here is the caller graph for this function:

void File_Namespace::GlobalFileMgr::free ( AbstractBuffer buffer)
inlineoverride

Definition at line 107 of file GlobalFileMgr.h.

References logger::FATAL, and LOG.

107 { LOG(FATAL) << "Operation not supported"; }
#define LOG(tag)
Definition: Logger.h:188
size_t File_Namespace::GlobalFileMgr::getAllocated ( )
inlineoverride

Definition at line 116 of file GlobalFileMgr.h.

116 { return 0; }
std::string File_Namespace::GlobalFileMgr::getBasePath ( ) const
inline

Definition at line 152 of file GlobalFileMgr.h.

Referenced by anonymous_namespace{TableArchiver.cpp}::abs_path(), File_Namespace::FileMgr::FileMgr(), and File_Namespace::FileMgr::init().

152 { return basePath_; }

+ Here is the caller graph for this function:

AbstractBuffer* File_Namespace::GlobalFileMgr::getBuffer ( const ChunkKey key,
const size_t  numBytes = 0 
)
inlineoverride

Returns the a pointer to the chunk with the specified key.

Definition at line 79 of file GlobalFileMgr.h.

79  {
80  return getFileMgr(key)->getBuffer(key, numBytes);
81  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
void File_Namespace::GlobalFileMgr::getChunkMetadataVecForKeyPrefix ( ChunkMetadataVector chunkMetadataVec,
const ChunkKey keyPrefix 
)
inlineoverride

Definition at line 121 of file GlobalFileMgr.h.

122  {
123  return getFileMgr(keyPrefix)->getChunkMetadataVecForKeyPrefix(chunkMetadataVec,
124  keyPrefix);
125  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
bool File_Namespace::GlobalFileMgr::getDBConvert ( ) const
inline

Definition at line 158 of file GlobalFileMgr.h.

Referenced by File_Namespace::FileMgr::getDBConvert().

158 { return dbConvert_; }

+ Here is the caller graph for this function:

int File_Namespace::GlobalFileMgr::getDBVersion ( ) const
inline

Definition at line 157 of file GlobalFileMgr.h.

Referenced by File_Namespace::FileMgr::getDBVersion().

157 { return mapd_db_version_; }
int mapd_db_version_
default page size, used to set FileMgr defaultPageSize_

+ Here is the caller graph for this function:

size_t File_Namespace::GlobalFileMgr::getDefaultPageSize ( ) const
inline

Definition at line 153 of file GlobalFileMgr.h.

153 { return defaultPageSize_; }
AbstractBufferMgr * File_Namespace::GlobalFileMgr::getFileMgr ( const int  db_id,
const int  tb_id 
)

Definition at line 130 of file GlobalFileMgr.cpp.

References allFileMgrs_, CHECK, defaultPageSize_, epoch_, fileMgrs_mutex_, findFileMgr(), ForeignStorageInterface::lookupBufferManager(), num_reader_threads_, and ownedFileMgrs_.

Referenced by checkpoint(), deleteBuffersWithPrefix(), foreign_storage::ForeignStorageCache::getCacheDirectoryForTablePrefix(), getTableEpoch(), and File_Namespace::FileMgr::init().

130  {
131  { // check if FileMgr already exists for (db_id, tb_id)
132  mapd_shared_lock<mapd_shared_mutex> read_lock(fileMgrs_mutex_);
133  AbstractBufferMgr* fm = findFileMgr(db_id, tb_id);
134  if (fm) {
135  return fm;
136  }
137  }
138 
139  { // create new FileMgr for (db_id, tb_id)
140  mapd_unique_lock<mapd_shared_mutex> write_lock(fileMgrs_mutex_);
141  AbstractBufferMgr* fm = findFileMgr(db_id, tb_id);
142  if (fm) {
143  return fm; // mgr was added between the read lock and the write lock
144  }
145  const auto file_mgr_key = std::make_pair(db_id, tb_id);
146  const auto foreign_buffer_manager =
148  if (foreign_buffer_manager) {
149  CHECK(allFileMgrs_.insert(std::make_pair(file_mgr_key, foreign_buffer_manager))
150  .second);
151  return foreign_buffer_manager;
152  } else {
153  auto s = std::make_shared<FileMgr>(
154  0, this, file_mgr_key, num_reader_threads_, epoch_, defaultPageSize_);
155  CHECK(ownedFileMgrs_.insert(std::make_pair(file_mgr_key, s)).second);
156  CHECK(allFileMgrs_.insert(std::make_pair(file_mgr_key, s.get())).second);
157  return s.get();
158  }
159  }
160 }
static Data_Namespace::AbstractBufferMgr * lookupBufferManager(const int db_id, const int table_id)
int epoch_
number of threads used when loading data
AbstractBufferMgr * findFileMgr(const int db_id, const int tb_id)
std::map< std::pair< int, int >, std::shared_ptr< FileMgr > > ownedFileMgrs_
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_
mapd_shared_lock< mapd_shared_mutex > read_lock
size_t num_reader_threads_
The OS file system path containing the files.
#define CHECK(condition)
Definition: Logger.h:197
mapd_shared_mutex fileMgrs_mutex_
mapd_unique_lock< mapd_shared_mutex > write_lock

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AbstractBufferMgr* File_Namespace::GlobalFileMgr::getFileMgr ( const ChunkKey key)
inline

Definition at line 148 of file GlobalFileMgr.h.

148  {
149  return getFileMgr(key[0], key[1]);
150  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
size_t File_Namespace::GlobalFileMgr::getInUseSize ( )
inlineoverride

Definition at line 115 of file GlobalFileMgr.h.

115 { return 0; }
size_t File_Namespace::GlobalFileMgr::getMaxSize ( )
inlineoverride

Definition at line 114 of file GlobalFileMgr.h.

114 { return 0; }
MgrType File_Namespace::GlobalFileMgr::getMgrType ( )
inlineoverride

Definition at line 109 of file GlobalFileMgr.h.

109 { return GLOBAL_FILE_MGR; };
size_t File_Namespace::GlobalFileMgr::getNumChunks ( )
override

Definition at line 87 of file GlobalFileMgr.cpp.

References allFileMgrs_, and fileMgrs_mutex_.

87  {
88  mapd_shared_lock<mapd_shared_mutex> read_lock(fileMgrs_mutex_);
89  size_t num_chunks = 0;
90  for (auto fileMgrsIt = allFileMgrs_.begin(); fileMgrsIt != allFileMgrs_.end();
91  ++fileMgrsIt) {
92  num_chunks += fileMgrsIt->second->getNumChunks();
93  }
94 
95  return num_chunks;
96 }
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_
mapd_shared_lock< mapd_shared_mutex > read_lock
mapd_shared_mutex fileMgrs_mutex_
size_t File_Namespace::GlobalFileMgr::getNumReaderThreads ( )
inline

Returns number of threads defined by parameter num-reader-threads which should be used during initial load and consequent read of data.

Definition at line 138 of file GlobalFileMgr.h.

138 { return num_reader_threads_; }
size_t num_reader_threads_
The OS file system path containing the files.
std::shared_ptr< FileMgr > File_Namespace::GlobalFileMgr::getSharedFileMgr ( const int  db_id,
const int  table_id 
)

Definition at line 163 of file GlobalFileMgr.cpp.

References ownedFileMgrs_.

164  {
165  const auto table_key = std::make_pair(db_id, table_id);
166  if (ownedFileMgrs_.find(table_key) == ownedFileMgrs_.end()) {
167  return nullptr;
168  }
169  return ownedFileMgrs_[table_key];
170 }
std::map< std::pair< int, int >, std::shared_ptr< FileMgr > > ownedFileMgrs_
std::string File_Namespace::GlobalFileMgr::getStringMgrType ( )
inlineoverride

Definition at line 110 of file GlobalFileMgr.h.

110 { return ToString(GLOBAL_FILE_MGR); }
size_t File_Namespace::GlobalFileMgr::getTableEpoch ( const int  db_id,
const int  tb_id 
)

Definition at line 234 of file GlobalFileMgr.cpp.

References CHECK, and getFileMgr().

234  {
235  auto fm = dynamic_cast<FileMgr*>(getFileMgr(db_id, tb_id));
236  CHECK(fm);
237  return fm->epoch_;
238 }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

void File_Namespace::GlobalFileMgr::init ( )

Definition at line 58 of file GlobalFileMgr.cpp.

References basePath_, logger::FATAL, and LOG.

Referenced by GlobalFileMgr().

58  {
59  // check if basePath_ already exists, and if not create one
60  boost::filesystem::path path(basePath_);
61  if (basePath_.size() > 0 && basePath_[basePath_.size() - 1] != '/') {
62  basePath_.push_back('/');
63  }
64  if (boost::filesystem::exists(path)) {
65  if (!boost::filesystem::is_directory(path)) {
66  LOG(FATAL) << "Specified path is not a directory.";
67  }
68  } else { // data directory does not exist
69  if (!boost::filesystem::create_directory(path)) {
70  LOG(FATAL) << "Could not create data directory";
71  }
72  }
73 }
#define LOG(tag)
Definition: Logger.h:188

+ Here is the caller graph for this function:

bool File_Namespace::GlobalFileMgr::isAllocationCapped ( )
inlineoverride

Definition at line 117 of file GlobalFileMgr.h.

117 { return false; }
bool File_Namespace::GlobalFileMgr::isBufferOnDevice ( const ChunkKey key)
inlineoverride

Definition at line 63 of file GlobalFileMgr.h.

63  {
64  return getFileMgr(key)->isBufferOnDevice(key);
65  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
std::string File_Namespace::GlobalFileMgr::printSlabs ( )
inlineoverride

Definition at line 111 of file GlobalFileMgr.h.

111 { return "Not Implemented"; }
AbstractBuffer* File_Namespace::GlobalFileMgr::putBuffer ( const ChunkKey key,
AbstractBuffer d,
const size_t  numBytes = 0 
)
inlineoverride

Puts the contents of d into the Chunk with the given key.

Parameters
key- Unique identifier for a Chunk.
d- An object representing the source data for the Chunk.
Returns
AbstractBuffer*

Definition at line 95 of file GlobalFileMgr.h.

97  {
98  return getFileMgr(key)->putBuffer(key, d, numBytes);
99  }
AbstractBufferMgr * getFileMgr(const int db_id, const int tb_id)
void File_Namespace::GlobalFileMgr::removeTableRelatedDS ( const int  db_id,
const int  tb_id 
)
override

Definition at line 199 of file GlobalFileMgr.cpp.

References File_Namespace::FileMgr::closeRemovePhysical(), deleteFileMgr(), fileMgrs_mutex_, and findFileMgr().

199  {
200  mapd_unique_lock<mapd_shared_mutex> write_lock(fileMgrs_mutex_);
201  auto fm = dynamic_cast<File_Namespace::FileMgr*>(findFileMgr(db_id, tb_id));
202  if (fm) {
203  fm->closeRemovePhysical();
204  } else {
205  // fileMgr has not been initialized so there is no need to
206  // spend the time initializing
207  // initialize just enough to have to rename
208  const auto file_mgr_key = std::make_pair(db_id, tb_id);
209  auto u = std::make_unique<FileMgr>(0, this, file_mgr_key, true);
210  u->closeRemovePhysical();
211  }
212  // remove table related in-memory DS only if directory was removed successfully
213 
214  deleteFileMgr(db_id, tb_id);
215 }
AbstractBufferMgr * findFileMgr(const int db_id, const int tb_id)
mapd_shared_mutex fileMgrs_mutex_
void deleteFileMgr(const int db_id, const int tb_id)
mapd_unique_lock< mapd_shared_mutex > write_lock

+ Here is the call graph for this function:

void File_Namespace::GlobalFileMgr::setDBConvert ( bool  val)
inline

Definition at line 159 of file GlobalFileMgr.h.

void File_Namespace::GlobalFileMgr::setFileMgr ( const int  db_id,
const int  table_id,
std::shared_ptr< FileMgr file_mgr 
)

Definition at line 173 of file GlobalFileMgr.cpp.

References allFileMgrs_, and ownedFileMgrs_.

175  {
176  allFileMgrs_[{db_id, table_id}] = file_mgr.get();
177  ownedFileMgrs_[{db_id, table_id}] = file_mgr;
178 }
std::map< std::pair< int, int >, std::shared_ptr< FileMgr > > ownedFileMgrs_
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_
void File_Namespace::GlobalFileMgr::setTableEpoch ( const int  db_id,
const int  tb_id,
const int  start_epoch 
)

Definition at line 217 of file GlobalFileMgr.cpp.

References defaultPageSize_, deleteFileMgr(), fileMgrs_mutex_, and num_reader_threads_.

219  {
220  mapd_unique_lock<mapd_shared_mutex> write_lock(fileMgrs_mutex_);
221  const auto file_mgr_key = std::make_pair(db_id, tb_id);
222  // this is where the real rollback of any data ahead of the currently set epoch is
223  // performed
224  auto u = std::make_unique<FileMgr>(
225  0, this, file_mgr_key, num_reader_threads_, start_epoch, defaultPageSize_);
226  u->setEpoch(start_epoch - 1);
227  // remove the dummy one we built
228  u.reset();
229 
230  // see if one exists currently, and remove it
231  deleteFileMgr(db_id, tb_id);
232 }
size_t num_reader_threads_
The OS file system path containing the files.
mapd_shared_mutex fileMgrs_mutex_
void deleteFileMgr(const int db_id, const int tb_id)
mapd_unique_lock< mapd_shared_mutex > write_lock

+ Here is the call graph for this function:

void File_Namespace::GlobalFileMgr::writeFileMgrData ( FileMgr fileMgr = 0)

Definition at line 180 of file GlobalFileMgr.cpp.

References allFileMgrs_, CHECK, File_Namespace::FileMgr::chunkIndex_, and fileMgrs_mutex_.

181  { // this function is not used, keep it for now for future needs
182  mapd_shared_lock<mapd_shared_mutex> read_lock(fileMgrs_mutex_);
183  for (auto fileMgrIt = allFileMgrs_.begin(); fileMgrIt != allFileMgrs_.end();
184  fileMgrIt++) {
185  FileMgr* fm = dynamic_cast<FileMgr*>(fileMgrIt->second);
186  CHECK(fm);
187  if ((fileMgr != 0) && (fileMgr != fm)) {
188  continue;
189  }
190  for (auto chunkIt = fm->chunkIndex_.begin(); chunkIt != fm->chunkIndex_.end();
191  chunkIt++) {
192  chunkIt->second->write((int8_t*)chunkIt->second, chunkIt->second->size(), 0);
193  // chunkIt->second->write((int8_t*)chunkIt->second, chunkIt->second->size(), 0,
194  // CPU_LEVEL, -1);
195  }
196  }
197 }
std::map< std::pair< int, int >, AbstractBufferMgr * > allFileMgrs_
mapd_shared_lock< mapd_shared_mutex > read_lock
#define CHECK(condition)
Definition: Logger.h:197
mapd_shared_mutex fileMgrs_mutex_

Member Data Documentation

std::map<std::pair<int, int>, AbstractBufferMgr*> File_Namespace::GlobalFileMgr::allFileMgrs_
private
std::string File_Namespace::GlobalFileMgr::basePath_
private

Definition at line 172 of file GlobalFileMgr.h.

Referenced by init().

bool File_Namespace::GlobalFileMgr::dbConvert_
private

DB version for DataMgr DS and corresponding file buffer read/write code

Definition at line 187 of file GlobalFileMgr.h.

Referenced by GlobalFileMgr().

size_t File_Namespace::GlobalFileMgr::defaultPageSize_
private

Definition at line 178 of file GlobalFileMgr.h.

Referenced by getFileMgr(), and setTableEpoch().

int File_Namespace::GlobalFileMgr::epoch_
private

number of threads used when loading data

Definition at line 174 of file GlobalFileMgr.h.

Referenced by getFileMgr().

mapd_shared_mutex File_Namespace::GlobalFileMgr::fileMgrs_mutex_
private
int File_Namespace::GlobalFileMgr::mapd_db_version_
private

default page size, used to set FileMgr defaultPageSize_

Definition at line 181 of file GlobalFileMgr.h.

Referenced by GlobalFileMgr().

size_t File_Namespace::GlobalFileMgr::num_reader_threads_
private

The OS file system path containing the files.

Definition at line 173 of file GlobalFileMgr.h.

Referenced by getFileMgr(), and setTableEpoch().

std::map<std::pair<int, int>, std::shared_ptr<FileMgr> > File_Namespace::GlobalFileMgr::ownedFileMgrs_
private

true if conversion should be done between different "mapd_db_version_"

Definition at line 190 of file GlobalFileMgr.h.

Referenced by deleteFileMgr(), getFileMgr(), getSharedFileMgr(), and setFileMgr().


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