OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{CachingFileMgr.cpp} Namespace Reference

Functions

size_t size_of_dir (const std::string &dir)
 
ChunkKey evict_chunk_or_fail (LRUEvictionAlgorithm &alg)
 

Function Documentation

ChunkKey anonymous_namespace{CachingFileMgr.cpp}::evict_chunk_or_fail ( LRUEvictionAlgorithm alg)

Definition at line 40 of file CachingFileMgr.cpp.

References LRUEvictionAlgorithm::evictNextChunk(), logger::FATAL, and LOG.

Referenced by File_Namespace::CachingFileMgr::evictMetadataPages(), and File_Namespace::CachingFileMgr::evictPages().

40  {
41  ChunkKey ret;
42  try {
43  ret = alg.evictNextChunk();
44  } catch (const NoEntryFoundException& e) {
45  LOG(FATAL) << "Disk cache needs to evict data to make space, but no data found in "
46  "eviction queue.";
47  }
48  return ret;
49 }
std::vector< int > ChunkKey
Definition: types.h:37
const ChunkKey evictNextChunk() override
#define LOG(tag)
Definition: Logger.h:203

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t anonymous_namespace{CachingFileMgr.cpp}::size_of_dir ( const std::string &  dir)

Definition at line 28 of file CachingFileMgr.cpp.

References omnisci::file_size().

Referenced by File_Namespace::CachingFileMgr::deleteCacheIfTooLarge().

28  {
29  size_t space_used = 0;
30  if (bf::exists(dir)) {
31  for (const auto& file : bf::recursive_directory_iterator(dir)) {
32  if (bf::is_regular_file(file.path())) {
33  space_used += bf::file_size(file.path());
34  }
35  }
36  }
37  return space_used;
38 }
size_t file_size(const int fd)
Definition: omnisci_fs.cpp:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function: