OmniSciDB  ca0c39ec8f
 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 45 of file CachingFileMgr.cpp.

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

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

45  {
46  ChunkKey ret;
47  try {
48  ret = alg.evictNextChunk();
49  } catch (const NoEntryFoundException& e) {
50  LOG(FATAL) << "Disk cache needs to evict data to make space, but no data found in "
51  "eviction queue.";
52  }
53  return ret;
54 }
std::vector< int > ChunkKey
Definition: types.h:36
const ChunkKey evictNextChunk() override
#define LOG(tag)
Definition: Logger.h:216

+ 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 33 of file CachingFileMgr.cpp.

References heavyai::file_size().

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

33  {
34  size_t space_used = 0;
35  if (bf::exists(dir)) {
36  for (const auto& file : bf::recursive_directory_iterator(dir)) {
37  if (bf::is_regular_file(file.path())) {
38  space_used += bf::file_size(file.path());
39  }
40  }
41  }
42  return space_used;
43 }
size_t file_size(const int fd)
Definition: heavyai_fs.cpp:33

+ Here is the call graph for this function:

+ Here is the caller graph for this function: