wrench::LogicalFileSystemLRUCaching

class LogicalFileSystemLRUCaching : public wrench::LogicalFileSystem

A class that implements a weak file system abstraction.

Public Functions

virtual void decrementNumRunningTransactionsForFileInDirectory(const std::shared_ptr<DataFile> &file, const std::string &absolute_path) override

Decrement the number of running transactions that have to do with a file.

Parameters:
  • file – the file

  • absolute_path – the file path

virtual void incrementNumRunningTransactionsForFileInDirectory(const std::shared_ptr<DataFile> &file, const std::string &absolute_path) override

Increment the number of running transactions that have to do with a file.

Parameters:
  • file – the file

  • absolute_path – the file path

virtual void removeAllFilesInDirectory(const std::string &absolute_path) override

Remove all files in a directory.

Parameters:

absolute_path – the directory’s absolute path

Throws:

std::invalid_argument

virtual void removeFileFromDirectory(const std::shared_ptr<DataFile> &file, const std::string &absolute_path) override

Remove a file in a directory.

Parameters:
  • file – the file to remove

  • absolute_path – the directory’s absolute path

Throws:

std::invalid_argument

virtual void storeFileInDirectory(const std::shared_ptr<DataFile> &file, const std::string &absolute_path) override

Store file in directory.

Parameters:
  • file – the file to store

  • absolute_path – the directory’s absolute path (at the mount point)

Throws:

std::invalid_argument

virtual void updateReadDate(const std::shared_ptr<DataFile> &file, const std::string &absolute_path) override

Update a file’s read date.

Parameters:
  • file – the file

  • absolute_path – the path

Public Members

unsigned int next_lru_sequence_number = 0

Next LRU sequence number.

struct FileOnDiskLRUCaching : public wrench::LogicalFileSystem::FileOnDisk

A helper struct to describe a file instance on disk.

Public Functions

inline FileOnDiskLRUCaching(double last_write_date, unsigned int lru_sequence_number, unsigned short num_current_transactions)

Constructor.

Parameters:
  • last_write_date – Last write date

  • lru_sequence_number – LRU sequence number

  • num_current_transactions – Number of current transactions using this file on disk

Public Members

unsigned int lru_sequence_number

The LRU sequence number (lower means older)

unsigned short num_current_transactions

The number of transactions that involve this file, meaning that it’s not evictable is > 0.