From 074da8d7dac25b5e12c5e76c67a1fa40ebcd4982 Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Sat, 28 Nov 2015 20:40:59 -0800 Subject: [PATCH] Fix the mmap dir of the memory pool of NVMEvictedTable. --- src/ee/anticache/AntiCacheDB.h | 4 ++++ src/ee/anticache/NVMEvictedTable.cpp | 8 +++++++- src/ee/common/executorcontext.hpp | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ee/anticache/AntiCacheDB.h b/src/ee/anticache/AntiCacheDB.h index e27aec5711..1b715979b8 100644 --- a/src/ee/anticache/AntiCacheDB.h +++ b/src/ee/anticache/AntiCacheDB.h @@ -315,6 +315,10 @@ class AntiCacheDB { return evictedTupleInBlock[blockId]; } + inline string getDBDir() { + return m_dbDir; + } + protected: ExecutorContext *m_executorContext; string m_dbDir; diff --git a/src/ee/anticache/NVMEvictedTable.cpp b/src/ee/anticache/NVMEvictedTable.cpp index a26936ca54..0bff02a2cd 100644 --- a/src/ee/anticache/NVMEvictedTable.cpp +++ b/src/ee/anticache/NVMEvictedTable.cpp @@ -33,7 +33,13 @@ namespace voltdb { NVMEvictedTable::NVMEvictedTable(ExecutorContext *ctx, const std::string name) : PersistentTable(ctx, false) { delete m_pool; - m_pool = new Pool(1024 * 1024 * 1024, 1024, m_executorContext->getDBDir() + "/" + name, true); + std::string dbName; + if (m_executorContext->getAntiCacheDB(0)->getDBType() == ANTICACHEDB_ALLOCATORNVM) + dbName = m_executorContext->getAntiCacheDB(0)->getDBDir(); + else + dbName = m_executorContext->getDBDir(); + //VOLT_ERROR("dbname: %s\n", dbName.c_str()); + m_pool = new Pool(1024 * 1024 * 1024, 1024, dbName + "/" + name, true); } diff --git a/src/ee/common/executorcontext.hpp b/src/ee/common/executorcontext.hpp index 0d2296729e..615182401e 100644 --- a/src/ee/common/executorcontext.hpp +++ b/src/ee/common/executorcontext.hpp @@ -124,8 +124,8 @@ namespace voltdb { inline std::string getDBDir() const { if (m_MMAPDir.empty()) - return "/mnt/pmfs/mmap_file"; // Default : "/tmp" - //return "/tmp"; // Default : "/tmp" + //return "/mnt/pmfs/mmap_file"; // Default : "/tmp" + return "/tmp"; // Default : "/tmp" return (m_MMAPDir); }