|
| bool | connect (const std::string &host_description) override |
| | Connect to the remote cache. More...
|
| |
| bool | is_connected () const override |
| | Check if we have a connection to the remote cache. More...
|
| |
| cache_entry_t | lookup (const std::string &hash) override |
| | 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) override |
| | 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) override |
| | Copy a cached file to the local file system. More...
|
| |
|
virtual | ~remote_cache_provider_t () |
| | De-initialzie the remote cache object.
|
| |
|
|
void | disconnect () |
| | Disconnect (usually as a result of an error).
|
| |
| std::string | get_data (const std::string &key) |
| | Get a binary data blob from the remote cache. More...
|
| |
| void | set_data (const std::string &key, const std::string &data) |
| | Set a binary data blob in the remote cache. More...
|
| |
|
|
redisContext * | m_ctx = nullptr |
| |
◆ add()
| void bcache::redis_cache_provider_t::add |
( |
const std::string & |
hash, |
|
|
const cache_entry_t & |
entry, |
|
|
const std::map< std::string, expected_file_t > & |
expected_files |
|
) |
| |
|
overridevirtual |
Adds a set of files to the cache.
- Parameters
-
| hash | The cache entry identifier. |
| entry | The cache entry data (files, stdout, etc). |
| expected_files | Paths to the actual files in the local file system (map from file ID to an expected file descriptor). |
Implements bcache::remote_cache_provider_t.
◆ connect()
| bool bcache::redis_cache_provider_t::connect |
( |
const std::string & |
host_description | ) |
|
|
overridevirtual |
Connect to the remote cache.
- Parameters
-
| host_description | A string describing the host to connect to (excluding protocol). |
- Returns
- true if the connection was successful.
Implements bcache::remote_cache_provider_t.
◆ get_data()
| std::string bcache::redis_cache_provider_t::get_data |
( |
const std::string & |
key | ) |
|
|
private |
Get a binary data blob from the remote cache.
- Parameters
-
| key | The unique key that identifies the data. |
- Returns
- the data as a string object.
- Exceptions
-
| runtime_error | if the data could not be retrieved (e.g. the key does not exist in the remote cache). |
◆ get_file()
| void bcache::redis_cache_provider_t::get_file |
( |
const std::string & |
hash, |
|
|
const std::string & |
source_id, |
|
|
const std::string & |
target_path, |
|
|
const bool |
is_compressed |
|
) |
| |
|
overridevirtual |
Copy a cached file to the local file system.
- Parameters
-
| hash | The cache entry identifier. |
| source_id | The ID of the remote file to copy. |
| target_path | The path to the local file. |
| is_compressed | True if the remote data is compressed. |
Implements bcache::remote_cache_provider_t.
◆ is_connected()
| bool bcache::redis_cache_provider_t::is_connected |
( |
| ) |
const |
|
overridevirtual |
◆ lookup()
| cache_entry_t bcache::redis_cache_provider_t::lookup |
( |
const std::string & |
hash | ) |
|
|
overridevirtual |
Check if an entry exists in the cache.
- Parameters
-
| hash | The cache entry identifier. |
- Returns
- A cache entry struct. If there was no cache hit the entry will be empty.
Implements bcache::remote_cache_provider_t.
◆ set_data()
| void bcache::redis_cache_provider_t::set_data |
( |
const std::string & |
key, |
|
|
const std::string & |
data |
|
) |
| |
|
private |
Set a binary data blob in the remote cache.
- Parameters
-
| key | The unique key that identifies the data. |
| data | The data as a string object. |
- Exceptions
-
| runtime_error | if the data could not be retrieved (e.g. the key does not exist in the remote cache). |
The documentation for this class was generated from the following files: