OmniSciDB  6686921089
 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 ()
 
std::vector< ChunkKeygetCachedChunksForKeyPrefix (const ChunkKey &) const
 
ChunkToBufferMap getChunkBuffersForCaching (const std::vector< 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 getCacheDirectory () const
 
std::string getCacheDirectoryForTable (int db_id, int tb_id) const
 
std::string getSerializedWrapperPath (int32_t db_id, int32_t tb_id) const
 
void cacheMetadataWithFragIdGreaterOrEqualTo (const ChunkMetadataVector &metadata_vec, const int frag_id)
 
uint64_t getSpaceReservedByTable (int db_id, int tb_id) const
 
void storeDataWrapper (const std::string &doc, int32_t db_id, int32_t tb_id)
 

Private Member Functions

std::set< ChunkKey >::iterator eraseChunk (const std::set< ChunkKey >::iterator &)
 
void eraseChunk (const ChunkKey &chunk_key)
 
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 54 of file ForeignStorageCache.cpp.

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

54  {
55  validatePath(config.path);
56  caching_file_mgr_ = std::make_unique<File_Namespace::CachingFileMgr>(config);
57 }
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 111 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 cacheMetadataWithFragIdGreaterOrEqualTo(), foreign_storage::CachingForeignStorageMgr::getChunkMetadataVecForKeyPrefix(), File_Namespace::CachingGlobalFileMgr::getChunkMetadataVecForKeyPrefix(), and foreign_storage::CachingForeignStorageMgr::refreshNonAppendTableInCache().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::cacheMetadataWithFragIdGreaterOrEqualTo ( const ChunkMetadataVector metadata_vec,
const int  frag_id 
)

Definition at line 257 of file ForeignStorageCache.cpp.

References cacheMetadataVec(), and CHUNK_KEY_FRAGMENT_IDX.

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

259  {
260  // Only re-cache last fragment and above
261  ChunkMetadataVector new_metadata_vec;
262  for (const auto& chunk_metadata : metadata_vec) {
263  if (chunk_metadata.first[CHUNK_KEY_FRAGMENT_IDX] >= frag_id) {
264  new_metadata_vec.push_back(chunk_metadata);
265  }
266  }
267  cacheMetadataVec(new_metadata_vec);
268 }
#define CHUNK_KEY_FRAGMENT_IDX
Definition: types.h:42
std::vector< std::pair< ChunkKey, std::shared_ptr< ChunkMetadata >>> ChunkMetadataVector
void cacheMetadataVec(const ChunkMetadataVector &)

+ 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 70 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

70  {
71  caching_file_mgr_->checkpoint(db_id, tb_id);
72 }
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 194 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and DEBUG_TIMER.

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

Definition at line 187 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 foreign_storage::CachingForeignStorageMgr::clearTable(), File_Namespace::CachingGlobalFileMgr::deleteBuffersWithPrefix(), foreign_storage::CachingForeignStorageMgr::removeTableRelatedDS(), and File_Namespace::CachingGlobalFileMgr::removeTableRelatedDS().

187  {
188  CHECK(is_table_key(chunk_prefix));
189  auto timer = DEBUG_TIMER(__func__);
190  caching_file_mgr_->clearForTable(chunk_prefix[CHUNK_KEY_DB_IDX],
191  chunk_prefix[CHUNK_KEY_TABLE_IDX]);
192 }
bool is_table_key(const ChunkKey &key)
Definition: types.h:45
#define CHUNK_KEY_DB_IDX
Definition: types.h:39
#define CHUNK_KEY_TABLE_IDX
Definition: types.h:40
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:209
#define DEBUG_TIMER(name)
Definition: Logger.h:352

+ 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 59 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

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

+ Here is the caller graph for this function:

std::string foreign_storage::ForeignStorageCache::dumpCachedChunkEntries ( ) const

Definition at line 229 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

229  {
230  return caching_file_mgr_->dumpKeysWithChunkData();
231 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::string foreign_storage::ForeignStorageCache::dumpCachedMetadataEntries ( ) const

Definition at line 233 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

233  {
234  return caching_file_mgr_->dumpKeysWithMetadata();
235 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
std::set<ChunkKey>::iterator foreign_storage::ForeignStorageCache::eraseChunk ( const std::set< ChunkKey >::iterator &  )
private

Referenced by cacheMetadataVec().

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::eraseChunk ( const ChunkKey chunk_key)
private

Definition at line 225 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

225  {
226  caching_file_mgr_->removeChunkKeepMetadata(chunk_key);
227 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
File_Namespace::FileBuffer * foreign_storage::ForeignStorageCache::getCachedChunkIfExists ( const ChunkKey chunk_key)

Definition at line 74 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(), and foreign_storage::CachingForeignStorageMgr::refreshChunksInCacheByFragment().

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

+ 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 203 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

204  {
205  return caching_file_mgr_->getChunkKeysForPrefix(chunk_prefix);
206 }
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 76 of file ForeignStorageCache.h.

76  {
77  return caching_file_mgr_->getFileMgrBasePath();
78  }
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 80 of file ForeignStorageCache.h.

80  {
81  return caching_file_mgr_->getTableFileMgrPath(db_id, tb_id);
82  }
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 174 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

176  {
177  caching_file_mgr_->getChunkMetadataVecForKeyPrefix(metadata_vec, chunk_prefix);
178 }
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 270 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and CHECK.

272  {
273  if (!is_new_buffer) {
274  CHECK(caching_file_mgr_->isBufferOnDevice(chunk_key));
275  return caching_file_mgr_->getBuffer(chunk_key);
276  } else {
277  CHECK(!caching_file_mgr_->isBufferOnDevice(chunk_key));
278  return caching_file_mgr_->createBuffer(chunk_key);
279  }
280 }
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:209
ChunkToBufferMap foreign_storage::ForeignStorageCache::getChunkBuffersForCaching ( const std::vector< ChunkKey > &  chunk_keys) const

Definition at line 208 of file ForeignStorageCache.cpp.

References caching_file_mgr_, and CHECK.

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

209  {
210  ChunkToBufferMap chunk_buffer_map;
211  for (const auto& chunk_key : chunk_keys) {
212  CHECK(caching_file_mgr_->isBufferOnDevice(chunk_key));
213  chunk_buffer_map[chunk_key] = caching_file_mgr_->getBuffer(chunk_key);
214  auto file_buf =
215  dynamic_cast<File_Namespace::FileBuffer*>(chunk_buffer_map[chunk_key]);
216  CHECK(file_buf);
217  CHECK(!file_buf->hasDataPages());
218 
219  // Clear all buffer metadata
220  file_buf->resetToEmpty();
221  }
222  return chunk_buffer_map;
223 }
std::map< ChunkKey, AbstractBuffer * > ChunkToBufferMap
Represents/provides access to contiguous data stored in the file system.
Definition: FileBuffer.h:58
std::unique_ptr< File_Namespace::CachingFileMgr > caching_file_mgr_
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the caller graph for this function:

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

Definition at line 65 of file ForeignStorageCache.h.

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

Definition at line 68 of file ForeignStorageCache.h.

68  {
69  return caching_file_mgr_->getNumChunksWithMetadata();
70  }
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 84 of file ForeignStorageCache.h.

References File_Namespace::CachingFileMgr::WRAPPER_FILE_NAME.

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

84  {
85  return getCacheDirectoryForTable(db_id, tb_id) + "/" +
87  }
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 180 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

181  {
182  ChunkMetadataVector meta_vec;
183  caching_file_mgr_->getChunkMetadataVecForKeyPrefix(meta_vec, chunk_prefix);
184  return (meta_vec.size() > 0);
185 }
std::vector< std::pair< ChunkKey, std::shared_ptr< ChunkMetadata >>> ChunkMetadataVector
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 103 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

103  {
104  auto buf = caching_file_mgr_->getBufferIfExists(chunk_key);
105  if (buf) {
106  return (*buf)->hasEncoder();
107  }
108  return false;
109 }
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 63 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().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ForeignStorageCache::storeDataWrapper ( const std::string &  doc,
int32_t  db_id,
int32_t  tb_id 
)

Definition at line 282 of file ForeignStorageCache.cpp.

References caching_file_mgr_.

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

284  {
285  caching_file_mgr_->writeWrapperFile(doc, db_id, tb_id);
286 }
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 237 of file ForeignStorageCache.cpp.

Referenced by ForeignStorageCache().

237  {
238  // check if base_path already exists, and if not create one
239  boost::filesystem::path path(base_path);
240  if (boost::filesystem::exists(path)) {
241  if (!boost::filesystem::is_directory(path)) {
242  throw std::runtime_error{
243  "cache path \"" + base_path +
244  "\" is not a directory. Please specify a valid directory "
245  "with --disk_cache_path=<path>, or use the default location."};
246  }
247  } else { // data directory does not exist
248  if (!boost::filesystem::create_directory(path)) {
249  throw std::runtime_error{
250  "could not create directory at cache path \"" + base_path +
251  "\". Please specify a valid directory location "
252  "with --disk_cache_path=<path> or use the default location."};
253  }
254  }
255 }

+ Here is the caller graph for this function:

Member Data Documentation


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