OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::ForeignStorageCache Class Reference

#include <ForeignStorageCache.h>

Public Member Functions

 ForeignStorageCache (const File_Namespace::DiskCacheConfig &config)
 
void checkpoint (const int32_t db_id, const int32_t tb_id)
 
void putBuffer (const ChunkKey &, AbstractBuffer *, const size_t numBytes=0)
 
File_Namespace::FileBuffergetCachedChunkIfExists (const ChunkKey &)
 
bool isMetadataCached (const ChunkKey &) const
 
void cacheMetadataVec (const ChunkMetadataVector &)
 
void getCachedMetadataVecForKeyPrefix (ChunkMetadataVector &, const ChunkKey &) const
 
bool hasCachedMetadataForKeyPrefix (const ChunkKey &) const
 
void clearForTablePrefix (const ChunkKey &)
 
void clear ()
 
size_t getMaxChunkDataSize () const
 
std::vector< ChunkKeygetCachedChunksForKeyPrefix (const ChunkKey &) const
 
ChunkToBufferMap getChunkBuffersForCaching (const std::set< ChunkKey > &chunk_keys) const
 
AbstractBuffergetChunkBufferForPrecaching (const ChunkKey &chunk_key, bool is_new_buffer)
 
void deleteBufferIfExists (const ChunkKey &chunk_key)
 
size_t getNumCachedChunks () const
 
size_t getNumCachedMetadata () const
 
std::string dumpCachedChunkEntries () const
 
std::string dumpCachedMetadataEntries () const
 
std::string dumpEvictionQueue () const
 
std::string dump () const
 
std::string getCacheDirectory () const
 
std::string getCacheDirectoryForTable (int db_id, int tb_id) const
 
std::string getSerializedWrapperPath (int32_t db_id, int32_t tb_id) const
 
uint64_t getSpaceReservedByTable (int db_id, int tb_id) const
 
void storeDataWrapper (const std::string &doc, int32_t db_id, int32_t tb_id)
 
bool hasStoredDataWrapperMetadata (int32_t db_id, int32_t table_id) const
 
void eraseChunk (const ChunkKey &chunk_key)
 
void setDataSizeLimit (size_t max) const
 

Private Member Functions

void validatePath (const std::string &) const
 

Private Attributes

std::unique_ptr
< File_Namespace::CachingFileMgr
caching_file_mgr_
 

Detailed Description

Definition at line 42 of file ForeignStorageCache.h.

Constructor & Destructor Documentation

foreign_storage::ForeignStorageCache::ForeignStorageCache ( const File_Namespace::DiskCacheConfig config)

Definition at line 52 of file ForeignStorageCache.cpp.

References caching_file_mgr_, File_Namespace::DiskCacheConfig::path, and validatePath().

52  {
53  validatePath(config.path);
54  caching_file_mgr_ = std::make_unique<File_Namespace::CachingFileMgr>(config);
55 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
void validatePath(const std::string &) const

+ Here is the call graph for this function:

Member Function Documentation

void foreign_storage::ForeignStorageCache::cacheMetadataVec ( const ChunkMetadataVector metadata_vec)

Definition at line 109 of file ForeignStorageCache.cpp.

References caching_file_mgr_, CHECK, CHUNK_KEY_COLUMN_IDX, CHUNK_KEY_DB_IDX, CHUNK_KEY_FRAGMENT_IDX, CHUNK_KEY_TABLE_IDX, DEBUG_TIMER, eraseChunk(), Data_Namespace::AbstractBuffer::getEncoder(), Encoder::getMetadata(), in_same_table(), is_varlen_data_key(), is_varlen_key(), foreign_storage::anonymous_namespace{ForeignStorageCache.cpp}::set_metadata_for_buffer(), and Data_Namespace::AbstractBuffer::setUpdated().

Referenced by foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), File_Namespace::CachingGlobalFileMgr::getChunkMetadataVecForKeyPrefix(), foreign_storage::CachingForeignStorageMgr::refreshAppendTableInCache(), and foreign_storage::CachingForeignStorageMgr::refreshNonAppendTableInCache().

109  {
110  auto timer = DEBUG_TIMER(__func__);
111  if (metadata_vec.empty()) {
112  return;
113  }
114  auto first_chunk_key = metadata_vec.begin()->first;
115  for (auto& [chunk_key, metadata] : metadata_vec) {
116  CHECK(in_same_table(chunk_key, first_chunk_key));
117  AbstractBuffer* buf;
118  AbstractBuffer* index_buffer = nullptr;
119  ChunkKey index_chunk_key;
120  if (is_varlen_key(chunk_key)) {
121  // For variable length chunks, metadata is associated with the data chunk.
122  CHECK(is_varlen_data_key(chunk_key));
123  index_chunk_key = {chunk_key[CHUNK_KEY_DB_IDX],
124  chunk_key[CHUNK_KEY_TABLE_IDX],
125  chunk_key[CHUNK_KEY_COLUMN_IDX],
126  chunk_key[CHUNK_KEY_FRAGMENT_IDX],
127  2};
128  }
129  bool chunk_in_cache = false;
130  if (!caching_file_mgr_->isBufferOnDevice(chunk_key)) {
131  buf = caching_file_mgr_->createBuffer(chunk_key);
132 
133  if (!index_chunk_key.empty()) {
134  CHECK(!caching_file_mgr_->isBufferOnDevice(index_chunk_key));
135  index_buffer = caching_file_mgr_->createBuffer(index_chunk_key);
136  CHECK(index_buffer);
137  }
138  } else {
139  buf = caching_file_mgr_->getBuffer(chunk_key);
140 
141  if (!index_chunk_key.empty()) {
142  CHECK(caching_file_mgr_->isBufferOnDevice(index_chunk_key));
143  index_buffer = caching_file_mgr_->getBuffer(index_chunk_key);
144  CHECK(index_buffer);
145  }
146 
147  // We should have already cleared the data unless we are appending
148  // If the buffer metadata has changed, we need to remove this chunk
149  if (buf->getEncoder() != nullptr) {
150  const std::shared_ptr<ChunkMetadata> buf_metadata =
151  std::make_shared<ChunkMetadata>();
152  buf->getEncoder()->getMetadata(buf_metadata);
153  chunk_in_cache = *metadata.get() == *buf_metadata;
154  }
155  }
156 
157  if (!chunk_in_cache) {
158  set_metadata_for_buffer(buf, metadata.get());
159  eraseChunk(chunk_key);
160 
161  if (!index_chunk_key.empty()) {
162  CHECK(index_buffer);
163  index_buffer->setUpdated();
164  eraseChunk(index_chunk_key);
165  }
166  }
167  }
168  caching_file_mgr_->checkpoint(first_chunk_key[CHUNK_KEY_DB_IDX],
169  first_chunk_key[CHUNK_KEY_TABLE_IDX]);
170 }
std::vector< int > ChunkKey
Definition: types.h:36
bool is_varlen_data_key(const ChunkKey &key)
Definition: types.h:75
void eraseChunk(const ChunkKey &chunk_key)
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_FRAGMENT_IDX
Definition: types.h:41
virtual void getMetadata(const std::shared_ptr< ChunkMetadata > &chunkMetadata)
Definition: Encoder.cpp:231
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
An AbstractBuffer is a unit of data management for a data manager.
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
void set_metadata_for_buffer(AbstractBuffer *buffer, ChunkMetadata *meta)
#define CHECK(condition)
Definition: Logger.h:291
#define DEBUG_TIMER(name)
Definition: Logger.h:412
#define CHUNK_KEY_COLUMN_IDX
Definition: types.h:40
bool in_same_table(const ChunkKey &left_key, const ChunkKey &right_key)
Definition: types.h:83
bool is_varlen_key(const ChunkKey &key)
Definition: types.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::checkpoint ( const int32_t  db_id,
const int32_t  tb_id 
)

Definition at line 68 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by File_Namespace::CachingGlobalFileMgr::checkpoint(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper(), and foreign_storage::CachingForeignStorageMgr::populateChunkBuffersSafely().

68  {
69  caching_file_mgr_->checkpoint(db_id, tb_id);
70 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::clear ( )

Definition at line 190 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and DEBUG_TIMER.

190  {
191  auto timer = DEBUG_TIMER(__func__);
192  // FileMgrs do not clean up after themselves nicely, so we need to close all their disk
193  // resources and then re-create the CachingFileMgr to reset it.
194  caching_file_mgr_->closeRemovePhysical();
195  boost::filesystem::create_directory(caching_file_mgr_->getFileMgrBasePath());
196  caching_file_mgr_ = caching_file_mgr_->reconstruct();
197 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define DEBUG_TIMER(name)
Definition: Logger.h:412
void foreign_storage::ForeignStorageCache::clearForTablePrefix ( const ChunkKey chunk_prefix)

Definition at line 183 of file ForeignStorageCache.cpp.

References caching_file_mgr_, CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, DEBUG_TIMER, and is_table_key().

Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::clear_cached_table_data(), foreign_storage::CachingForeignStorageMgr::clearTable(), File_Namespace::CachingGlobalFileMgr::deleteBuffersWithPrefix(), File_Namespace::CachingGlobalFileMgr::removeCachedData(), and foreign_storage::CachingForeignStorageMgr::removeTableRelatedDS().

183  {
184  CHECK(is_table_key(chunk_prefix));
185  auto timer = DEBUG_TIMER(__func__);
186  caching_file_mgr_->clearForTable(chunk_prefix[CHUNK_KEY_DB_IDX],
187  chunk_prefix[CHUNK_KEY_TABLE_IDX]);
188 }
bool is_table_key(const ChunkKey &key)
Definition: types.h:44
#define CHUNK_KEY_DB_IDX
Definition: types.h:38
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:39
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:291
#define DEBUG_TIMER(name)
Definition: Logger.h:412

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::deleteBufferIfExists ( const ChunkKey chunk_key)

Definition at line 57 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by File_Namespace::CachingGlobalFileMgr::deleteBuffer().

57  {
58  caching_file_mgr_->deleteBufferIfExists(chunk_key);
59 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

std::string foreign_storage::ForeignStorageCache::dump ( ) const
inline

Definition at line 77 of file ForeignStorageCache.h.

77 { return caching_file_mgr_->dump(); }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::dumpCachedChunkEntries ( ) const

Definition at line 208 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

208  {
209  return caching_file_mgr_->dumpKeysWithChunkData();
210 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::dumpCachedMetadataEntries ( ) const

Definition at line 212 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

212  {
213  return caching_file_mgr_->dumpKeysWithMetadata();
214 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::dumpEvictionQueue ( ) const

Definition at line 216 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

216  {
217  return caching_file_mgr_->dumpEvictionQueue();
218 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
void foreign_storage::ForeignStorageCache::eraseChunk ( const ChunkKey chunk_key)

Definition at line 204 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by cacheMetadataVec(), foreign_storage::CachingForeignStorageMgr::evictChunkFromCache(), and foreign_storage::CachingForeignStorageMgr::fetchBuffer().

204  {
205  caching_file_mgr_->removeChunkKeepMetadata(chunk_key);
206 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

File_Namespace::FileBuffer * foreign_storage::ForeignStorageCache::getCachedChunkIfExists ( const ChunkKey chunk_key)

Definition at line 72 of file ForeignStorageCache.cpp.

References caching_file_mgr_, CHUNK_KEY_VARLEN_IDX, and is_varlen_data_key().

Referenced by foreign_storage::CachingForeignStorageMgr::fetchBuffer(), File_Namespace::CachingGlobalFileMgr::fetchBuffer(), foreign_storage::CachingForeignStorageMgr::isChunkCached(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

73  {
74  auto buf = caching_file_mgr_->getBufferIfExists(chunk_key);
75 
76  if (buf) {
77  if ((*buf)->hasDataPages()) {
78  // 1. If the buffer has data pages then must be in the cache.
79  return *buf;
80  }
81  if (is_varlen_data_key(chunk_key)) {
82  // 2. If the buffer is a varlen data buffer and the
83  // corresponding chunk contains only nulls, then even
84  // without data pages it will still have been cached
85  // if it has a corresponding index buffer which does
86  // have dataPages
87  // Note the empty buffer proviso that the size be 0,
88  // corresponding to all nulls in the chunk
89  auto index_chunk_key = chunk_key;
90  index_chunk_key[CHUNK_KEY_VARLEN_IDX] = 2;
91  auto index_buffer = caching_file_mgr_->getBufferIfExists(index_chunk_key);
92  if (index_buffer && (*index_buffer)->hasDataPages() && (*buf)->size() == 0) {
93  return *buf;
94  }
95  }
96  }
97  // 3. Otherwise this chunk hasn't been cached.
98  return nullptr;
99 }
bool is_varlen_data_key(const ChunkKey &key)
Definition: types.h:75
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHUNK_KEY_VARLEN_IDX
Definition: types.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< ChunkKey > foreign_storage::ForeignStorageCache::getCachedChunksForKeyPrefix ( const ChunkKey chunk_prefix) const

Definition at line 199 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::refreshTableInCache().

200  {
201  return caching_file_mgr_->getChunkKeysForPrefix(chunk_prefix);
202 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

std::string foreign_storage::ForeignStorageCache::getCacheDirectory ( ) const
inline

Definition at line 79 of file ForeignStorageCache.h.

79  {
80  return caching_file_mgr_->getFileMgrBasePath();
81  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::getCacheDirectoryForTable ( int  db_id,
int  tb_id 
) const
inline

Definition at line 83 of file ForeignStorageCache.h.

83  {
84  return caching_file_mgr_->getTableFileMgrPath(db_id, tb_id);
85  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
void foreign_storage::ForeignStorageCache::getCachedMetadataVecForKeyPrefix ( ChunkMetadataVector metadata_vec,
const ChunkKey chunk_prefix 
) const

Definition at line 172 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists(), foreign_storage::CachingForeignStorageMgr::getBufferSize(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), File_Namespace::CachingGlobalFileMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::getHighestCachedFragId().

174  {
175  caching_file_mgr_->getChunkMetadataVecForKeyPrefix(metadata_vec, chunk_prefix);
176 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

AbstractBuffer * foreign_storage::ForeignStorageCache::getChunkBufferForPrecaching ( const ChunkKey chunk_key,
bool  is_new_buffer 
)

Definition at line 256 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and CHECK.

258  {
259  if (!is_new_buffer) {
260  CHECK(caching_file_mgr_->isBufferOnDevice(chunk_key));
261  return caching_file_mgr_->getBuffer(chunk_key);
262  } else {
263  CHECK(!caching_file_mgr_->isBufferOnDevice(chunk_key));
264  return caching_file_mgr_->createBuffer(chunk_key);
265  }
266 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:291
ChunkToBufferMap foreign_storage::ForeignStorageCache::getChunkBuffersForCaching ( const std::set< ChunkKey > &  chunk_keys) const

Definition at line 240 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and CHECK.

Referenced by foreign_storage::CachingForeignStorageMgr::fetchBuffer(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

241  {
242  ChunkToBufferMap chunk_buffer_map;
243  for (const auto& key : keys) {
244  CHECK(caching_file_mgr_->isBufferOnDevice(key));
245  chunk_buffer_map[key] = caching_file_mgr_->getBuffer(key);
246  auto file_buf = dynamic_cast<File_Namespace::FileBuffer*>(chunk_buffer_map[key]);
247  CHECK(file_buf);
248  CHECK(!file_buf->hasDataPages());
249 
250  // Clear all buffer metadata
251  file_buf->resetToEmpty();
252  }
253  return chunk_buffer_map;
254 }
std::map< ChunkKey, AbstractBuffer * > ChunkToBufferMap
Represents/provides access to contiguous data stored in the file system.
Definition: FileBuffer.h:57
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

size_t foreign_storage::ForeignStorageCache::getMaxChunkDataSize ( ) const
inline

Definition at line 55 of file ForeignStorageCache.h.

Referenced by foreign_storage::CachingForeignStorageMgr::maxFetchSize().

55 { return caching_file_mgr_->getMaxDataFilesSize(); }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

size_t foreign_storage::ForeignStorageCache::getNumCachedChunks ( ) const
inline

Definition at line 66 of file ForeignStorageCache.h.

66  {
67  return caching_file_mgr_->getNumDataChunks();
68  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
size_t foreign_storage::ForeignStorageCache::getNumCachedMetadata ( ) const
inline

Definition at line 69 of file ForeignStorageCache.h.

69  {
70  return caching_file_mgr_->getNumChunksWithMetadata();
71  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::getSerializedWrapperPath ( int32_t  db_id,
int32_t  tb_id 
) const
inline

Definition at line 87 of file ForeignStorageCache.h.

References File_Namespace::CachingFileMgr::WRAPPER_FILE_NAME.

Referenced by foreign_storage::CachingForeignStorageMgr::createDataWrapperIfNotExists(), and foreign_storage::CachingForeignStorageMgr::eraseDataWrapper().

87  {
88  return getCacheDirectoryForTable(db_id, tb_id) + "/" +
90  }
std::string getCacheDirectoryForTable(int db_id, int tb_id) const
static constexpr char WRAPPER_FILE_NAME[]

+ Here is the caller graph for this function:

uint64_t foreign_storage::ForeignStorageCache::getSpaceReservedByTable ( int  db_id,
int  tb_id 
) const
inline

Definition at line 92 of file ForeignStorageCache.h.

92  {
93  return caching_file_mgr_->getSpaceReservedByTable(db_id, tb_id);
94  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
bool foreign_storage::ForeignStorageCache::hasCachedMetadataForKeyPrefix ( const ChunkKey chunk_prefix) const

Definition at line 178 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::clearTable(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), File_Namespace::CachingGlobalFileMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::getHighestCachedFragId().

179  {
180  return caching_file_mgr_->hasChunkMetadataForKeyPrefix(chunk_prefix);
181 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

bool foreign_storage::ForeignStorageCache::hasStoredDataWrapperMetadata ( int32_t  db_id,
int32_t  table_id 
) const

Definition at line 274 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::hasStoredDataWrapper().

275  {
276  return caching_file_mgr_->hasWrapperFile(db_id, table_id);
277 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

bool foreign_storage::ForeignStorageCache::isMetadataCached ( const ChunkKey chunk_key) const

Definition at line 101 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

101  {
102  auto buf = caching_file_mgr_->getBufferIfExists(chunk_key);
103  if (buf) {
104  return (*buf)->hasEncoder();
105  }
106  return false;
107 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::putBuffer ( const ChunkKey key,
AbstractBuffer buf,
const size_t  numBytes = 0 
)

Definition at line 61 of file ForeignStorageCache.cpp.

References caching_file_mgr_, CHECK, and Data_Namespace::AbstractBuffer::isDirty().

Referenced by File_Namespace::CachingGlobalFileMgr::checkpoint(), File_Namespace::CachingGlobalFileMgr::fetchBuffer(), and File_Namespace::CachingGlobalFileMgr::putBuffer().

63  {
64  caching_file_mgr_->putBuffer(key, buf, num_bytes);
65  CHECK(!buf->isDirty());
66 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::setDataSizeLimit ( size_t  max) const
inline

Definition at line 103 of file ForeignStorageCache.h.

103  {
104  caching_file_mgr_->setDataSizeLimit(max);
105  }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
void foreign_storage::ForeignStorageCache::storeDataWrapper ( const std::string &  doc,
int32_t  db_id,
int32_t  tb_id 
)

Definition at line 268 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

Referenced by foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecFromDataWrapper().

270  {
271  caching_file_mgr_->writeWrapperFile(doc, db_id, tb_id);
272 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::validatePath ( const std::string &  base_path) const
private

Definition at line 220 of file ForeignStorageCache.cpp.

Referenced by ForeignStorageCache().

220  {
221  // check if base_path already exists, and if not create one
222  boost::filesystem::path path(base_path);
223  if (boost::filesystem::exists(path)) {
224  if (!boost::filesystem::is_directory(path)) {
225  throw std::runtime_error{
226  "cache path \"" + base_path +
227  "\" is not a directory. Please specify a valid directory "
228  "with --disk_cache_path=<path>, or use the default location."};
229  }
230  } else { // data directory does not exist
231  if (!boost::filesystem::create_directory(path)) {
232  throw std::runtime_error{
233  "could not create directory at cache path \"" + base_path +
234  "\". Please specify a valid directory location "
235  "with --disk_cache_path=<path> or use the default location."};
236  }
237  }
238 }

+ Here is the caller graph for this function:

Member Data Documentation


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