OmniSciDB  a5dc49c757
 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 43 of file CachingFileMgr.cpp.

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

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

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

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

References heavyai::file_size().

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

31  {
32  size_t space_used = 0;
33  if (bf::exists(dir)) {
34  for (const auto& file : bf::recursive_directory_iterator(dir)) {
35  if (bf::is_regular_file(file.path())) {
36  space_used += bf::file_size(file.path());
37  }
38  }
39  }
40  return space_used;
41 }
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: