BuildCache
Public Member Functions | Private Attributes | List of all members
bcache::remote_cache_t Class Reference

Public Member Functions

 remote_cache_t ()
 Initialize the remote cache object.
 
 ~remote_cache_t ()
 De-initialzie the remote cache object.
 
bool connect ()
 Connect to the remote cache. More...
 
bool is_connected () const
 Check if we have a connection to the remote cache. More...
 
cache_entry_t lookup (const std::string &hash)
 Check if an entry exists in the cache. More...
 
void add (const std::string &hash, const cache_entry_t &entry, const std::map< std::string, expected_file_t > &expected_files)
 Adds a set of files to the cache. More...
 
void get_file (const std::string &hash, const std::string &source_id, const std::string &target_path, const bool is_compressed)
 Copy a cached file to the local file system. More...
 

Private Attributes

remote_cache_provider_tm_provider = nullptr
 

Member Function Documentation

◆ add()

void bcache::remote_cache_t::add ( const std::string &  hash,
const cache_entry_t entry,
const std::map< std::string, expected_file_t > &  expected_files 
)

Adds a set of files to the cache.

Parameters
hashThe cache entry identifier.
entryThe cache entry data (files, stdout, etc).
expected_filesPaths to the actual files in the local file system (map from file ID to an expected file descriptor).

◆ connect()

bool bcache::remote_cache_t::connect ( )

Connect to the remote cache.

Returns
true if the connection was successful.

◆ get_file()

void bcache::remote_cache_t::get_file ( const std::string &  hash,
const std::string &  source_id,
const std::string &  target_path,
const bool  is_compressed 
)

Copy a cached file to the local file system.

Parameters
hashThe cache entry identifier.
source_idThe ID of the remote file to copy.
target_pathThe path to the local file.
is_compressedTrue if the remote data is compressed.

◆ is_connected()

bool bcache::remote_cache_t::is_connected ( ) const

Check if we have a connection to the remote cache.

Returns
true if we have a connection to the remote cache.

◆ lookup()

cache_entry_t bcache::remote_cache_t::lookup ( const std::string &  hash)

Check if an entry exists in the cache.

Parameters
hashThe cache entry identifier.
Returns
A cache entry struct. If there was no cache hit the entry will be empty.

The documentation for this class was generated from the following files: