wrench::XRootD::Cache

class Cache

A class that implements the XRootD cache.

Public Functions

void add(std::shared_ptr<DataFile> file, std::set<std::shared_ptr<FileLocation>> locations)

Add a file to the cache.

Parameters
  • file – The file to add to the cache

  • locations – The locations to add to the cache

void add(std::shared_ptr<DataFile> file, std::shared_ptr<FileLocation> location)

Add a file to the cache.

Parameters
  • file – The file to add to the cache

  • location – The location to add to the cache

std::set<std::shared_ptr<FileLocation>> get(std::shared_ptr<DataFile> file)

get all valid cached copies.

Parameters

file – The file to check the cache for

Returns

the set of valid cached copies. (empty set if not found)

bool isCached(std::shared_ptr<DataFile> file)

Check the cache for a file.

Parameters

file – The file to check the cache for

Returns

true if the file is cached and if timestamp (not implemented) is valid, false otherwise

std::set<std::shared_ptr<FileLocation>> operator[](std::shared_ptr<DataFile> file)

get all valid cached copies.

Parameters

file – The file to check the cache for

Returns

the set of valid cached copies. (empty set if not found)

void remove(std::shared_ptr<DataFile> file)

remove all copies of a file from the cache

Parameters

file – The file to check the cache for

Public Members

double maxCacheTime = std::numeric_limits<double>::infinity()

The maximum time an unupdated entry can remain in the cache.