OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data_Namespace::DataMgr Class Reference

#include <DataMgr.h>

+ Collaboration diagram for Data_Namespace::DataMgr:

Classes

struct  SystemMemoryUsage
 

Public Member Functions

 DataMgr (const std::string &dataDir, const SystemParameters &system_parameters, std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr, const bool useGpus, const size_t reservedGpuMem=(1<< 27), const size_t numReaderThreads=0, const File_Namespace::DiskCacheConfig cacheConfig=File_Namespace::DiskCacheConfig())
 
 ~DataMgr ()
 
AbstractBuffercreateChunkBuffer (const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t page_size=0)
 
AbstractBuffergetChunkBuffer (const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t numBytes=0)
 
void deleteChunksWithPrefix (const ChunkKey &keyPrefix)
 
void deleteChunksWithPrefix (const ChunkKey &keyPrefix, const MemoryLevel memLevel)
 
AbstractBufferalloc (const MemoryLevel memoryLevel, const int deviceId, const size_t numBytes)
 
void free (AbstractBuffer *buffer)
 
void copy (AbstractBuffer *destBuffer, AbstractBuffer *srcBuffer)
 
bool isBufferOnDevice (const ChunkKey &key, const MemoryLevel memLevel, const int deviceId)
 
std::vector< MemoryInfogetMemoryInfo (const MemoryLevel memLevel)
 
std::string dumpLevel (const MemoryLevel memLevel)
 
void clearMemory (const MemoryLevel memLevel)
 
const std::map< ChunkKey,
File_Namespace::FileBuffer * > & 
getChunkMap ()
 
void checkpoint (const int db_id, const int tb_id)
 
void checkpoint (const int db_id, const int table_id, const MemoryLevel memory_level)
 
void getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunkMetadataVec, const ChunkKey &keyPrefix)
 
bool gpusPresent () const
 
void removeTableRelatedDS (const int db_id, const int tb_id)
 
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)
 
CudaMgr_Namespace::CudaMgrgetCudaMgr () const
 
File_Namespace::GlobalFileMgrgetGlobalFileMgr () const
 
std::shared_ptr
< ForeignStorageInterface
getForeignStorageInterface () const
 
std::unique_ptr< DeviceAllocatorcreateGpuAllocator (int device_id)
 
SystemMemoryUsage getSystemMemoryUsage () const
 
PersistentStorageMgrgetPersistentStorageMgr () const
 
void resetPersistentStorage (const File_Namespace::DiskCacheConfig &cache_config, const size_t num_reader_threads, const SystemParameters &sys_params)
 
Buffer_Namespace::CpuBufferMgrgetCpuBufferMgr () const
 

Static Public Member Functions

static size_t getTotalSystemMemory ()
 

Public Attributes

std::vector< int > levelSizes_
 

Private Member Functions

void populateMgrs (const SystemParameters &system_parameters, const size_t userSpecifiedNumReaderThreads, const File_Namespace::DiskCacheConfig &cache_config)
 
void convertDB (const std::string basePath)
 
void checkpoint ()
 
void createTopLevelMetadata () const
 
void allocateCpuBufferMgr (int32_t device_id, size_t total_cpu_size, size_t minCpuSlabSize, size_t maxCpuSlabSize, size_t page_size, const std::vector< size_t > &cpu_tier_sizes)
 

Private Attributes

std::vector< std::vector
< AbstractBufferMgr * > > 
bufferMgrs_
 
std::unique_ptr
< CudaMgr_Namespace::CudaMgr
cudaMgr_
 
std::string dataDir_
 
bool hasGpus_
 
size_t reservedGpuMem_
 
std::mutex buffer_access_mutex_
 

Friends

class GlobalFileMgr
 

Detailed Description

Definition at line 170 of file DataMgr.h.

Constructor & Destructor Documentation

Data_Namespace::DataMgr::DataMgr ( const std::string &  dataDir,
const SystemParameters system_parameters,
std::unique_ptr< CudaMgr_Namespace::CudaMgr cudaMgr,
const bool  useGpus,
const size_t  reservedGpuMem = (1 << 27),
const size_t  numReaderThreads = 0,
const File_Namespace::DiskCacheConfig  cacheConfig = File_Namespace::DiskCacheConfig() 
)
explicit

Definition at line 51 of file DataMgr.cpp.

58  : cudaMgr_{std::move(cudaMgr)}
59  , dataDir_{dataDir}
60  , hasGpus_{false}
61  , reservedGpuMem_{reservedGpuMem} {
62  if (useGpus) {
63  if (cudaMgr_) {
64  hasGpus_ = true;
65  } else {
66  LOG(ERROR) << "CudaMgr instance is invalid, falling back to CPU-only mode.";
67  hasGpus_ = false;
68  }
69  } else {
70  // NOTE: useGpus == false with a valid cudaMgr is a potentially valid configuration.
71  // i.e. QueryEngine can be set to cpu-only for a cuda-enabled build, but still have
72  // rendering enabled. The renderer would require a CudaMgr in this case, in addition
73  // to a GpuCudaBufferMgr for cuda-backed thrust allocations.
74  // We're still setting hasGpus_ to false in that case tho to enforce cpu-only query
75  // execution.
76  hasGpus_ = false;
77  }
78 
79  populateMgrs(system_parameters, numReaderThreads, cache_config);
81 }
#define LOG(tag)
Definition: Logger.h:203
void createTopLevelMetadata() const
Definition: DataMgr.cpp:334
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263
void populateMgrs(const SystemParameters &system_parameters, const size_t userSpecifiedNumReaderThreads, const File_Namespace::DiskCacheConfig &cache_config)
Definition: DataMgr.cpp:216
std::string dataDir_
Definition: DataMgr.h:264
Data_Namespace::DataMgr::~DataMgr ( )

Definition at line 83 of file DataMgr.cpp.

References bufferMgrs_.

83  {
84  int numLevels = bufferMgrs_.size();
85  for (int level = numLevels - 1; level >= 0; --level) {
86  for (size_t device = 0; device < bufferMgrs_[level].size(); device++) {
87  delete bufferMgrs_[level][device];
88  }
89  }
90 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

Member Function Documentation

AbstractBuffer * Data_Namespace::DataMgr::alloc ( const MemoryLevel  memoryLevel,
const int  deviceId,
const size_t  numBytes 
)

Definition at line 513 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, CHECK_LT, and levelSizes_.

Referenced by ThrustAllocator::allocate(), ThrustAllocator::allocateScopedBuffer(), CudaAllocator::allocGpuAbstractBuffer(), InValuesBitmap::InValuesBitmap(), ColumnFetcher::linearizeFixedLenArrayColFrags(), and ColumnFetcher::linearizeVarLenArrayColFrags().

515  {
516  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
517  const auto level = static_cast<int>(memoryLevel);
518  CHECK_LT(deviceId, levelSizes_[level]);
519  return bufferMgrs_[level][deviceId]->alloc(numBytes);
520 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223
#define CHECK_LT(x, y)
Definition: Logger.h:219

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::allocateCpuBufferMgr ( int32_t  device_id,
size_t  total_cpu_size,
size_t  minCpuSlabSize,
size_t  maxCpuSlabSize,
size_t  page_size,
const std::vector< size_t > &  cpu_tier_sizes 
)
private

Definition at line 172 of file DataMgr.cpp.

References bufferMgrs_, and cudaMgr_.

Referenced by populateMgrs().

177  {
178 #ifdef ENABLE_MEMKIND
179  if (g_enable_tiered_cpu_mem) {
181  total_cpu_size,
182  cudaMgr_.get(),
183  minCpuSlabSize,
184  maxCpuSlabSize,
185  page_size,
186  cpu_tier_sizes,
187  bufferMgrs_[0][0]));
188  return;
189  }
190 #endif
191 
192  bufferMgrs_[1].push_back(new Buffer_Namespace::CpuBufferMgr(0,
193  total_cpu_size,
194  cudaMgr_.get(),
195  minCpuSlabSize,
196  maxCpuSlabSize,
197  page_size,
198  bufferMgrs_[0][0]));
199 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::checkpoint ( const int  db_id,
const int  tb_id 
)

Definition at line 550 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

Referenced by UpdelRoll::stageUpdate().

550  {
551  // TODO(adb): do we need a buffer mgr lock here?
552  // MAT Yes to reduce Parallel Executor TSAN issues (and correctness for now)
553  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
554  for (auto levelIt = bufferMgrs_.rbegin(); levelIt != bufferMgrs_.rend(); ++levelIt) {
555  // use reverse iterator so we start at GPU level, then CPU then DISK
556  for (auto deviceIt = levelIt->begin(); deviceIt != levelIt->end(); ++deviceIt) {
557  (*deviceIt)->checkpoint(db_id, tb_id);
558  }
559  }
560 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::checkpoint ( const int  db_id,
const int  table_id,
const MemoryLevel  memory_level 
)

Definition at line 562 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, CHECK_LT, and levelSizes_.

564  {
565  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
566  CHECK_LT(static_cast<size_t>(memory_level), bufferMgrs_.size());
567  CHECK_LT(static_cast<size_t>(memory_level), levelSizes_.size());
568  for (int device_id = 0; device_id < levelSizes_[memory_level]; device_id++) {
569  bufferMgrs_[memory_level][device_id]->checkpoint(db_id, table_id);
570  }
571 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223
#define CHECK_LT(x, y)
Definition: Logger.h:219
void Data_Namespace::DataMgr::checkpoint ( )
private

Definition at line 573 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

Referenced by convertDB().

573  {
574  // TODO(adb): SAA
575  // MAT Yes to reduce Parallel Executor TSAN issues (and correctness for now)
576  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
577  for (auto levelIt = bufferMgrs_.rbegin(); levelIt != bufferMgrs_.rend(); ++levelIt) {
578  // use reverse iterator so we start at GPU level, then CPU then DISK
579  for (auto deviceIt = levelIt->begin(); deviceIt != levelIt->end(); ++deviceIt) {
580  (*deviceIt)->checkpoint();
581  }
582  }
583 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::clearMemory ( const MemoryLevel  memLevel)

Definition at line 431 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, CHECK, cudaMgr_, Data_Namespace::GPU_LEVEL, logger::INFO, LOG, and logger::WARNING.

431  {
432  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
433 
434  // if gpu we need to iterate through all the buffermanagers for each card
435  if (memLevel == MemoryLevel::GPU_LEVEL) {
436  if (cudaMgr_) {
437  int numGpus = cudaMgr_->getDeviceCount();
438  for (int gpuNum = 0; gpuNum < numGpus; ++gpuNum) {
439  LOG(INFO) << "clear slabs on gpu " << gpuNum;
440  auto buffer_mgr_for_gpu =
441  dynamic_cast<Buffer_Namespace::BufferMgr*>(bufferMgrs_[memLevel][gpuNum]);
442  CHECK(buffer_mgr_for_gpu);
443  buffer_mgr_for_gpu->clearSlabs();
444  }
445  } else {
446  LOG(WARNING) << "Unable to clear GPU memory: No GPUs detected";
447  }
448  } else {
449  auto buffer_mgr_for_cpu =
450  dynamic_cast<Buffer_Namespace::BufferMgr*>(bufferMgrs_[memLevel][0]);
451  CHECK(buffer_mgr_for_cpu);
452  buffer_mgr_for_cpu->clearSlabs();
453  }
454 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
#define LOG(tag)
Definition: Logger.h:203
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:96
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263
#define CHECK(condition)
Definition: Logger.h:209
void Data_Namespace::DataMgr::convertDB ( const std::string  basePath)
private

Definition at line 303 of file DataMgr.cpp.

References bufferMgrs_, CHECK, checkpoint(), logger::FATAL, getGlobalFileMgr(), logger::INFO, and LOG.

303  {
304  // no need for locking, as this is only called in the constructor
305 
306  /* check that "mapd_data" directory exists and it's empty */
307  std::string mapdDataPath(basePath + "/../mapd_data/");
308  boost::filesystem::path path(mapdDataPath);
309  if (boost::filesystem::exists(path)) {
310  if (!boost::filesystem::is_directory(path)) {
311  LOG(FATAL) << "Path to directory mapd_data to convert DB is not a directory.";
312  }
313  } else { // data directory does not exist
314  LOG(FATAL) << "Path to directory mapd_data to convert DB does not exist.";
315  }
316 
317  File_Namespace::GlobalFileMgr* gfm{nullptr};
318  gfm = dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])->getGlobalFileMgr();
319  CHECK(gfm);
320 
321  size_t defaultPageSize = gfm->getDefaultPageSize();
322  LOG(INFO) << "Database conversion started.";
324  gfm,
325  defaultPageSize,
326  basePath); // this call also copies data into new DB structure
327  delete fm_base_db;
328 
329  /* write content of DB into newly created/converted DB structure & location */
330  checkpoint(); // outputs data files as well as metadata files
331  LOG(INFO) << "Database conversion completed.";
332 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
#define LOG(tag)
Definition: Logger.h:203
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:604
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

void Data_Namespace::DataMgr::copy ( AbstractBuffer destBuffer,
AbstractBuffer srcBuffer 
)

Definition at line 536 of file DataMgr.cpp.

References Data_Namespace::AbstractBuffer::getDeviceId(), Data_Namespace::AbstractBuffer::getMemoryPtr(), Data_Namespace::AbstractBuffer::getType(), Data_Namespace::AbstractBuffer::size(), and Data_Namespace::AbstractBuffer::write().

536  {
537  destBuffer->write(srcBuffer->getMemoryPtr(),
538  srcBuffer->size(),
539  0,
540  srcBuffer->getType(),
541  srcBuffer->getDeviceId());
542 }
virtual int8_t * getMemoryPtr()=0
virtual MemoryLevel getType() const =0
virtual void write(int8_t *src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_buffer_type=CPU_LEVEL, const int src_device_id=-1)=0

+ Here is the call graph for this function:

AbstractBuffer * Data_Namespace::DataMgr::createChunkBuffer ( const ChunkKey key,
const MemoryLevel  memoryLevel,
const int  deviceId = 0,
const size_t  page_size = 0 
)

Definition at line 469 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

Referenced by Chunk_NS::Chunk::createChunkBuffer().

472  {
473  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
474  int level = static_cast<int>(memoryLevel);
475  return bufferMgrs_[level][deviceId]->createBuffer(key, page_size);
476 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

std::unique_ptr< DeviceAllocator > Data_Namespace::DataMgr::createGpuAllocator ( int  device_id)

Definition at line 522 of file DataMgr.cpp.

References UNREACHABLE.

Referenced by copy_projection_buffer_from_gpu_columnar(), QueryMemoryInitializer::copyFromTableFunctionGpuBuffers(), anonymous_namespace{ResultSetIteration.cpp}::fetch_data_from_gpu(), InValuesBitmap::InValuesBitmap(), BaselineJoinHashTable::toSet(), and BaselineJoinHashTable::toString().

522  {
523 #ifdef HAVE_CUDA
524  return std::make_unique<CudaAllocator>(this, device_id);
525 #else
526  UNREACHABLE();
527 #endif
528 }
#define UNREACHABLE()
Definition: Logger.h:253

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::createTopLevelMetadata ( ) const
private

Definition at line 334 of file DataMgr.cpp.

References bufferMgrs_, CHECK, and getGlobalFileMgr().

Referenced by resetPersistentStorage().

335  { // create metadata shared by all tables of all DBs
336  ChunkKey chunkKey(2);
337  chunkKey[0] = 0; // top level db_id
338  chunkKey[1] = 0; // top level tb_id
339 
340  File_Namespace::GlobalFileMgr* gfm{nullptr};
341  gfm = dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])->getGlobalFileMgr();
342  CHECK(gfm);
343 
344  auto fm_top = gfm->getFileMgr(chunkKey);
345  if (dynamic_cast<File_Namespace::FileMgr*>(fm_top)) {
346  static_cast<File_Namespace::FileMgr*>(fm_top)->createTopLevelMetadata();
347  }
348 }
std::vector< int > ChunkKey
Definition: types.h:37
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
void createTopLevelMetadata() const
Definition: DataMgr.cpp:334
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:604
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::deleteChunksWithPrefix ( const ChunkKey keyPrefix)

Definition at line 489 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, and levelSizes_.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::prepare_for_system_table_execution(), UpdelRoll::updateFragmenterAndCleanupChunks(), StorageIOFacility::yieldDeleteCallback(), and StorageIOFacility::yieldUpdateCallback().

489  {
490  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
491 
492  int numLevels = bufferMgrs_.size();
493  for (int level = numLevels - 1; level >= 0; --level) {
494  for (int device = 0; device < levelSizes_[level]; ++device) {
495  bufferMgrs_[level][device]->deleteBuffersWithPrefix(keyPrefix);
496  }
497  }
498 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::deleteChunksWithPrefix ( const ChunkKey keyPrefix,
const MemoryLevel  memLevel 
)

Definition at line 501 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, and levelSizes_.

502  {
503  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
504 
505  if (bufferMgrs_.size() <= memLevel) {
506  return;
507  }
508  for (int device = 0; device < levelSizes_[memLevel]; ++device) {
509  bufferMgrs_[memLevel][device]->deleteBuffersWithPrefix(keyPrefix);
510  }
511 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223
std::string Data_Namespace::DataMgr::dumpLevel ( const MemoryLevel  memLevel)

Definition at line 415 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, cudaMgr_, and Data_Namespace::GPU_LEVEL.

415  {
416  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
417 
418  // if gpu we need to iterate through all the buffermanagers for each card
419  if (memLevel == MemoryLevel::GPU_LEVEL) {
420  int numGpus = cudaMgr_->getDeviceCount();
421  std::ostringstream tss;
422  for (int gpuNum = 0; gpuNum < numGpus; ++gpuNum) {
423  tss << bufferMgrs_[memLevel][gpuNum]->printSlabs();
424  }
425  return tss.str();
426  } else {
427  return bufferMgrs_[memLevel][0]->printSlabs();
428  }
429 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263
void Data_Namespace::DataMgr::free ( AbstractBuffer buffer)

Definition at line 530 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, Data_Namespace::AbstractBuffer::getDeviceId(), and Data_Namespace::AbstractBuffer::getType().

Referenced by UpdelRoll::cancelUpdate(), ThrustAllocator::deallocate(), CudaAllocator::free(), CudaAllocator::freeGpuAbstractBuffer(), CudaAllocator::~CudaAllocator(), InValuesBitmap::~InValuesBitmap(), PerfectHashTable::~PerfectHashTable(), and ThrustAllocator::~ThrustAllocator().

530  {
531  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
532  int level = static_cast<int>(buffer->getType());
533  bufferMgrs_[level][buffer->getDeviceId()]->free(buffer);
534 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
virtual MemoryLevel getType() const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AbstractBuffer * Data_Namespace::DataMgr::getChunkBuffer ( const ChunkKey key,
const MemoryLevel  memoryLevel,
const int  deviceId = 0,
const size_t  numBytes = 0 
)

Definition at line 478 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, CHECK_LT, and levelSizes_.

Referenced by Chunk_NS::Chunk::getChunkBuffer().

481  {
482  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
483  const auto level = static_cast<size_t>(memoryLevel);
484  CHECK_LT(level, levelSizes_.size()); // make sure we have a legit buffermgr
485  CHECK_LT(deviceId, levelSizes_[level]); // make sure we have a legit buffermgr
486  return bufferMgrs_[level][deviceId]->getBuffer(key, numBytes);
487 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223
#define CHECK_LT(x, y)
Definition: Logger.h:219

+ Here is the caller graph for this function:

const std::map<ChunkKey, File_Namespace::FileBuffer*>& Data_Namespace::DataMgr::getChunkMap ( )
void Data_Namespace::DataMgr::getChunkMetadataVecForKeyPrefix ( ChunkMetadataVector chunkMetadataVec,
const ChunkKey keyPrefix 
)

Definition at line 463 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

Referenced by TableOptimizer::vacuumFragments().

464  {
465  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
466  bufferMgrs_[0][0]->getChunkMetadataVecForKeyPrefix(chunkMetadataVec, keyPrefix);
467 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

Buffer_Namespace::CpuBufferMgr * Data_Namespace::DataMgr::getCpuBufferMgr ( ) const

Definition at line 636 of file DataMgr.cpp.

References bufferMgrs_.

636  {
637  return dynamic_cast<Buffer_Namespace::CpuBufferMgr*>(bufferMgrs_[1][0]);
638 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
CudaMgr_Namespace::CudaMgr* Data_Namespace::DataMgr::getCudaMgr ( ) const
inline

Definition at line 218 of file DataMgr.h.

References cudaMgr_.

Referenced by copy_to_nvidia_gpu(), CudaAllocator::copyFromDevice(), CudaAllocator::copyToDevice(), CudaAllocator::CudaAllocator(), Executor::cudaMgr(), get_available_gpus(), CudaAllocator::setDeviceMem(), and CudaAllocator::zeroDeviceMem().

218 { return cudaMgr_.get(); }
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263

+ Here is the caller graph for this function:

std::shared_ptr< ForeignStorageInterface > Data_Namespace::DataMgr::getForeignStorageInterface ( ) const

Definition at line 612 of file DataMgr.cpp.

References bufferMgrs_.

612  {
613  return dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])
615 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::shared_ptr< ForeignStorageInterface > getForeignStorageInterface() const
Definition: DataMgr.cpp:612
File_Namespace::GlobalFileMgr * Data_Namespace::DataMgr::getGlobalFileMgr ( ) const

Definition at line 604 of file DataMgr.cpp.

References bufferMgrs_, and CHECK.

Referenced by convertDB(), createTopLevelMetadata(), TableArchiver::dumpTable(), anonymous_namespace{DdlCommandExecutor.cpp}::get_agg_storage_stats(), getTableEpoch(), TableArchiver::restoreTable(), setTableEpoch(), and TableOptimizer::vacuumDeletedRows().

604  {
605  File_Namespace::GlobalFileMgr* global_file_mgr{nullptr};
606  global_file_mgr =
607  dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])->getGlobalFileMgr();
608  CHECK(global_file_mgr);
609  return global_file_mgr;
610 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:604
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the caller graph for this function:

std::vector< MemoryInfo > Data_Namespace::DataMgr::getMemoryInfo ( const MemoryLevel  memLevel)

Definition at line 350 of file DataMgr.cpp.

References buffer_access_mutex_, bufferMgrs_, CHECK, Data_Namespace::MemoryData::chunk_key, Data_Namespace::CPU_LEVEL, cudaMgr_, Buffer_Namespace::BufferMgr::getAllocated(), Buffer_Namespace::BufferMgr::getMaxSize(), Buffer_Namespace::BufferMgr::getPageSize(), Buffer_Namespace::BufferMgr::getSlabSegments(), Data_Namespace::GPU_LEVEL, hasGpus_, Data_Namespace::MemoryInfo::isAllocationCapped, Buffer_Namespace::BufferMgr::isAllocationCapped(), Data_Namespace::MemoryInfo::maxNumPages, Data_Namespace::MemoryData::memStatus, Data_Namespace::MemoryInfo::nodeMemoryData, Data_Namespace::MemoryInfo::numPageAllocated, Data_Namespace::MemoryData::numPages, Data_Namespace::MemoryInfo::pageSize, Data_Namespace::MemoryData::slabNum, Data_Namespace::MemoryData::startPage, and Data_Namespace::MemoryData::touch.

350  {
351  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
352 
353  std::vector<MemoryInfo> mem_info;
354  if (memLevel == MemoryLevel::CPU_LEVEL) {
355  Buffer_Namespace::CpuBufferMgr* cpu_buffer =
356  dynamic_cast<Buffer_Namespace::CpuBufferMgr*>(
358  CHECK(cpu_buffer);
359  MemoryInfo mi;
360 
361  mi.pageSize = cpu_buffer->getPageSize();
362  mi.maxNumPages = cpu_buffer->getMaxSize() / mi.pageSize;
363  mi.isAllocationCapped = cpu_buffer->isAllocationCapped();
364  mi.numPageAllocated = cpu_buffer->getAllocated() / mi.pageSize;
365 
366  const auto& slab_segments = cpu_buffer->getSlabSegments();
367  for (size_t slab_num = 0; slab_num < slab_segments.size(); ++slab_num) {
368  for (auto segment : slab_segments[slab_num]) {
369  MemoryData md;
370  md.slabNum = slab_num;
371  md.startPage = segment.start_page;
372  md.numPages = segment.num_pages;
373  md.touch = segment.last_touched;
374  md.memStatus = segment.mem_status;
375  md.chunk_key.insert(
376  md.chunk_key.end(), segment.chunk_key.begin(), segment.chunk_key.end());
377  mi.nodeMemoryData.push_back(md);
378  }
379  }
380  mem_info.push_back(mi);
381  } else if (hasGpus_) {
382  int numGpus = cudaMgr_->getDeviceCount();
383  for (int gpuNum = 0; gpuNum < numGpus; ++gpuNum) {
385  dynamic_cast<Buffer_Namespace::GpuCudaBufferMgr*>(
387  CHECK(gpu_buffer);
388  MemoryInfo mi;
389 
390  mi.pageSize = gpu_buffer->getPageSize();
391  mi.maxNumPages = gpu_buffer->getMaxSize() / mi.pageSize;
392  mi.isAllocationCapped = gpu_buffer->isAllocationCapped();
393  mi.numPageAllocated = gpu_buffer->getAllocated() / mi.pageSize;
394 
395  const auto& slab_segments = gpu_buffer->getSlabSegments();
396  for (size_t slab_num = 0; slab_num < slab_segments.size(); ++slab_num) {
397  for (auto segment : slab_segments[slab_num]) {
398  MemoryData md;
399  md.slabNum = slab_num;
400  md.startPage = segment.start_page;
401  md.numPages = segment.num_pages;
402  md.touch = segment.last_touched;
403  md.chunk_key.insert(
404  md.chunk_key.end(), segment.chunk_key.begin(), segment.chunk_key.end());
405  md.memStatus = segment.mem_status;
406  mi.nodeMemoryData.push_back(md);
407  }
408  }
409  mem_info.push_back(mi);
410  }
411  }
412  return mem_info;
413 }
size_t getAllocated() override
Definition: BufferMgr.cpp:500
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< MemoryData > nodeMemoryData
Definition: DataMgr.h:72
Buffer_Namespace::MemStatus memStatus
Definition: DataMgr.h:64
size_t getMaxSize() override
Definition: BufferMgr.cpp:495
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
bool isAllocationCapped() override
Definition: BufferMgr.cpp:505
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263
const std::vector< BufferList > & getSlabSegments()
Definition: BufferMgr.cpp:886
#define CHECK(condition)
Definition: Logger.h:209
std::vector< int32_t > chunk_key
Definition: DataMgr.h:63

+ Here is the call graph for this function:

PersistentStorageMgr * Data_Namespace::DataMgr::getPersistentStorageMgr ( ) const

Definition at line 632 of file DataMgr.cpp.

References bufferMgrs_.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::set_parallelism_hints().

632  {
633  return dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0]);
634 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

DataMgr::SystemMemoryUsage Data_Namespace::DataMgr::getSystemMemoryUsage ( ) const

Definition at line 92 of file DataMgr.cpp.

References Data_Namespace::DataMgr::SystemMemoryUsage::frag, Data_Namespace::DataMgr::SystemMemoryUsage::free, Data_Namespace::ProcBuddyinfoParser::getFragmentationPercent(), Data_Namespace::DataMgr::SystemMemoryUsage::regular, Data_Namespace::DataMgr::SystemMemoryUsage::resident, Data_Namespace::DataMgr::SystemMemoryUsage::shared, Data_Namespace::DataMgr::SystemMemoryUsage::total, and Data_Namespace::DataMgr::SystemMemoryUsage::vtotal.

92  {
93  SystemMemoryUsage usage;
94 
95 #ifdef __linux__
96 
97  // Determine Linux available memory and total memory.
98  // Available memory is different from free memory because
99  // when Linux sees free memory, it tries to use it for
100  // stuff like disk caching. However, the memory is not
101  // reserved and is still available to be allocated by
102  // user processes.
103  // Parsing /proc/meminfo for this info isn't very elegant
104  // but as a virtual file it should be reasonably fast.
105  // See also:
106  // https://github.com/torvalds/linux/commit/34e431b0ae398fc54ea69ff85ec700722c9da773
108  usage.free = mi["MemAvailable"];
109  usage.total = mi["MemTotal"];
110 
111  // Determine process memory in use.
112  // See also:
113  // https://stackoverflow.com/questions/669438/how-to-get-memory-usage-at-runtime-using-c
114  // http://man7.org/linux/man-pages/man5/proc.5.html
115  int64_t size = 0;
116  int64_t resident = 0;
117  int64_t shared = 0;
118 
119  std::ifstream fstatm("/proc/self/statm");
120  fstatm >> size >> resident >> shared;
121  fstatm.close();
122 
123  long page_size =
124  sysconf(_SC_PAGE_SIZE); // in case x86-64 is configured to use 2MB pages
125 
126  usage.resident = resident * page_size;
127  usage.vtotal = size * page_size;
128  usage.regular = (resident - shared) * page_size;
129  usage.shared = shared * page_size;
130 
132  usage.frag = bi.getFragmentationPercent();
133 
134 #else
135 
136  usage.total = 0;
137  usage.free = 0;
138  usage.resident = 0;
139  usage.vtotal = 0;
140  usage.regular = 0;
141  usage.shared = 0;
142  usage.frag = 0;
143 
144 #endif
145 
146  return usage;
147 }
Parse /proc/meminfo into key/value pairs.
Definition: DataMgr.h:76
Parse /proc/buddyinfo into a Fragmentation health score.
Definition: DataMgr.h:109

+ Here is the call graph for this function:

size_t Data_Namespace::DataMgr::getTableEpoch ( const int  db_id,
const int  tb_id 
)

Definition at line 597 of file DataMgr.cpp.

References bufferMgrs_, CHECK, and getGlobalFileMgr().

597  {
598  File_Namespace::GlobalFileMgr* gfm{nullptr};
599  gfm = dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])->getGlobalFileMgr();
600  CHECK(gfm);
601  return gfm->getTableEpoch(db_id, tb_id);
602 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:604
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

size_t Data_Namespace::DataMgr::getTotalSystemMemory ( )
static

Definition at line 149 of file DataMgr.cpp.

Referenced by populateMgrs().

149  {
150 #ifdef __APPLE__
151  int mib[2];
152  size_t physical_memory;
153  size_t length;
154  // Get the Physical memory size
155  mib[0] = CTL_HW;
156  mib[1] = HW_MEMSIZE;
157  length = sizeof(size_t);
158  sysctl(mib, 2, &physical_memory, &length, NULL, 0);
159  return physical_memory;
160 #elif defined(_MSC_VER)
161  MEMORYSTATUSEX status;
162  status.dwLength = sizeof(status);
163  GlobalMemoryStatusEx(&status);
164  return status.ullTotalPhys;
165 #else // Linux
166  long pages = sysconf(_SC_PHYS_PAGES);
167  long page_size = sysconf(_SC_PAGE_SIZE);
168  return pages * page_size;
169 #endif
170 }

+ Here is the caller graph for this function:

bool Data_Namespace::DataMgr::gpusPresent ( ) const
inline

Definition at line 213 of file DataMgr.h.

References hasGpus_.

Referenced by get_available_gpus().

213 { return hasGpus_; }

+ Here is the caller graph for this function:

bool Data_Namespace::DataMgr::isBufferOnDevice ( const ChunkKey key,
const MemoryLevel  memLevel,
const int  deviceId 
)

Definition at line 456 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

Referenced by Chunk_NS::Chunk::isChunkOnDevice().

458  {
459  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
460  return bufferMgrs_[memLevel][deviceId]->isBufferOnDevice(key);
461 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::populateMgrs ( const SystemParameters system_parameters,
const size_t  userSpecifiedNumReaderThreads,
const File_Namespace::DiskCacheConfig cache_config 
)
private

Definition at line 216 of file DataMgr.cpp.

References allocateCpuBufferMgr(), bufferMgrs_, SystemParameters::cpu_buffer_mem_bytes, cudaMgr_, dataDir_, Data_Namespace::DRAM, g_pmem_size, getTotalSystemMemory(), SystemParameters::gpu_buffer_mem_bytes, hasGpus_, logger::INFO, levelSizes_, LOG, SystemParameters::max_cpu_slab_size, SystemParameters::max_gpu_slab_size, SystemParameters::min_cpu_slab_size, SystemParameters::min_gpu_slab_size, Data_Namespace::numCpuTiers, Data_Namespace::PMEM, reservedGpuMem_, and VLOG.

Referenced by resetPersistentStorage().

218  {
219  // no need for locking, as this is only called in the constructor
220  bufferMgrs_.resize(2);
221  bufferMgrs_[0].push_back(
222  new PersistentStorageMgr(dataDir_, userSpecifiedNumReaderThreads, cache_config));
223 
224  levelSizes_.push_back(1);
225  size_t page_size{512};
226  size_t cpuBufferSize = system_parameters.cpu_buffer_mem_bytes;
227  if (cpuBufferSize == 0) { // if size is not specified
228  const auto total_system_memory = getTotalSystemMemory();
229  VLOG(1) << "Detected " << (float)total_system_memory / (1024 * 1024)
230  << "M of total system memory.";
231  cpuBufferSize = total_system_memory *
232  0.8; // should get free memory instead of this ugly heuristic
233  }
234  size_t minCpuSlabSize = std::min(system_parameters.min_cpu_slab_size, cpuBufferSize);
235  minCpuSlabSize = (minCpuSlabSize / page_size) * page_size;
236  size_t maxCpuSlabSize = std::min(system_parameters.max_cpu_slab_size, cpuBufferSize);
237  maxCpuSlabSize = (maxCpuSlabSize / page_size) * page_size;
238  LOG(INFO) << "Min CPU Slab Size is " << (float)minCpuSlabSize / (1024 * 1024) << "MB";
239  LOG(INFO) << "Max CPU Slab Size is " << (float)maxCpuSlabSize / (1024 * 1024) << "MB";
240  LOG(INFO) << "Max memory pool size for CPU is " << (float)cpuBufferSize / (1024 * 1024)
241  << "MB";
242 
243  size_t total_cpu_size = 0;
244 
245 #ifdef ENABLE_MEMKIND
246  CpuTierSizeVector cpu_tier_sizes(numCpuTiers, 0);
247  cpu_tier_sizes[CpuTier::DRAM] = cpuBufferSize;
248  if (g_enable_tiered_cpu_mem) {
249  cpu_tier_sizes[CpuTier::PMEM] = g_pmem_size;
250  LOG(INFO) << "Max memory pool size for PMEM is " << (float)g_pmem_size / (1024 * 1024)
251  << "MB";
252  }
253  for (auto cpu_tier_size : cpu_tier_sizes) {
254  total_cpu_size += cpu_tier_size;
255  }
256 #else
257  CpuTierSizeVector cpu_tier_sizes{};
258  total_cpu_size = cpuBufferSize;
259 #endif
260 
261  if (hasGpus_ || cudaMgr_) {
262  LOG(INFO) << "Reserved GPU memory is " << (float)reservedGpuMem_ / (1024 * 1024)
263  << "MB includes render buffer allocation";
264  bufferMgrs_.resize(3);
266  0, total_cpu_size, minCpuSlabSize, maxCpuSlabSize, page_size, cpu_tier_sizes);
267 
268  levelSizes_.push_back(1);
269  int numGpus = cudaMgr_->getDeviceCount();
270  for (int gpuNum = 0; gpuNum < numGpus; ++gpuNum) {
271  size_t gpuMaxMemSize =
272  system_parameters.gpu_buffer_mem_bytes != 0
273  ? system_parameters.gpu_buffer_mem_bytes
274  : (cudaMgr_->getDeviceProperties(gpuNum)->globalMem) - (reservedGpuMem_);
275  size_t minGpuSlabSize =
276  std::min(system_parameters.min_gpu_slab_size, gpuMaxMemSize);
277  minGpuSlabSize = (minGpuSlabSize / page_size) * page_size;
278  size_t maxGpuSlabSize =
279  std::min(system_parameters.max_gpu_slab_size, gpuMaxMemSize);
280  maxGpuSlabSize = (maxGpuSlabSize / page_size) * page_size;
281  LOG(INFO) << "Min GPU Slab size for GPU " << gpuNum << " is "
282  << (float)minGpuSlabSize / (1024 * 1024) << "MB";
283  LOG(INFO) << "Max GPU Slab size for GPU " << gpuNum << " is "
284  << (float)maxGpuSlabSize / (1024 * 1024) << "MB";
285  LOG(INFO) << "Max memory pool size for GPU " << gpuNum << " is "
286  << (float)gpuMaxMemSize / (1024 * 1024) << "MB";
287  bufferMgrs_[2].push_back(new Buffer_Namespace::GpuCudaBufferMgr(gpuNum,
288  gpuMaxMemSize,
289  cudaMgr_.get(),
290  minGpuSlabSize,
291  maxGpuSlabSize,
292  page_size,
293  bufferMgrs_[1][0]));
294  }
295  levelSizes_.push_back(numGpus);
296  } else {
298  0, total_cpu_size, minCpuSlabSize, maxCpuSlabSize, page_size, cpu_tier_sizes);
299  levelSizes_.push_back(1);
300  }
301 }
size_t g_pmem_size
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
std::vector< int > levelSizes_
Definition: DataMgr.h:223
#define LOG(tag)
Definition: Logger.h:203
constexpr size_t numCpuTiers
static size_t getTotalSystemMemory()
Definition: DataMgr.cpp:149
std::unique_ptr< CudaMgr_Namespace::CudaMgr > cudaMgr_
Definition: DataMgr.h:263
void allocateCpuBufferMgr(int32_t device_id, size_t total_cpu_size, size_t minCpuSlabSize, size_t maxCpuSlabSize, size_t page_size, const std::vector< size_t > &cpu_tier_sizes)
Definition: DataMgr.cpp:172
std::vector< size_t > CpuTierSizeVector
#define VLOG(n)
Definition: Logger.h:303
std::string dataDir_
Definition: DataMgr.h:264

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Data_Namespace::DataMgr::removeTableRelatedDS ( const int  db_id,
const int  tb_id 
)

Definition at line 585 of file DataMgr.cpp.

References buffer_access_mutex_, and bufferMgrs_.

585  {
586  std::lock_guard<std::mutex> buffer_lock(buffer_access_mutex_);
587  bufferMgrs_[0][0]->removeTableRelatedDS(db_id, tb_id);
588 }
std::mutex buffer_access_mutex_
Definition: DataMgr.h:267
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
void Data_Namespace::DataMgr::resetPersistentStorage ( const File_Namespace::DiskCacheConfig cache_config,
const size_t  num_reader_threads,
const SystemParameters sys_params 
)

Definition at line 202 of file DataMgr.cpp.

References bufferMgrs_, createTopLevelMetadata(), and populateMgrs().

204  {
205  int numLevels = bufferMgrs_.size();
206  for (int level = numLevels - 1; level >= 0; --level) {
207  for (size_t device = 0; device < bufferMgrs_[level].size(); device++) {
208  delete bufferMgrs_[level][device];
209  }
210  }
211  bufferMgrs_.clear();
212  populateMgrs(sys_params, num_reader_threads, cache_config);
214 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
void createTopLevelMetadata() const
Definition: DataMgr.cpp:334
void populateMgrs(const SystemParameters &system_parameters, const size_t userSpecifiedNumReaderThreads, const File_Namespace::DiskCacheConfig &cache_config)
Definition: DataMgr.cpp:216

+ Here is the call graph for this function:

void Data_Namespace::DataMgr::setTableEpoch ( const int  db_id,
const int  tb_id,
const int  start_epoch 
)

Definition at line 590 of file DataMgr.cpp.

References bufferMgrs_, CHECK, and getGlobalFileMgr().

590  {
591  File_Namespace::GlobalFileMgr* gfm{nullptr};
592  gfm = dynamic_cast<PersistentStorageMgr*>(bufferMgrs_[0][0])->getGlobalFileMgr();
593  CHECK(gfm);
594  gfm->setTableEpoch(db_id, tb_id, start_epoch);
595 }
std::vector< std::vector< AbstractBufferMgr * > > bufferMgrs_
Definition: DataMgr.h:262
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:604
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class GlobalFileMgr
friend

Definition at line 171 of file DataMgr.h.

Member Data Documentation

std::unique_ptr<CudaMgr_Namespace::CudaMgr> Data_Namespace::DataMgr::cudaMgr_
private
std::string Data_Namespace::DataMgr::dataDir_
private

Definition at line 264 of file DataMgr.h.

Referenced by populateMgrs().

bool Data_Namespace::DataMgr::hasGpus_
private

Definition at line 265 of file DataMgr.h.

Referenced by getMemoryInfo(), gpusPresent(), and populateMgrs().

std::vector<int> Data_Namespace::DataMgr::levelSizes_

Definition at line 223 of file DataMgr.h.

Referenced by alloc(), checkpoint(), deleteChunksWithPrefix(), getChunkBuffer(), and populateMgrs().

size_t Data_Namespace::DataMgr::reservedGpuMem_
private

Definition at line 266 of file DataMgr.h.

Referenced by populateMgrs().


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