|
| 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.
|
| |
|
| virtual std::vector< std::string > | get_header (const std::string &method, const std::string &key) const |
| | Get the headers for the HTTP request. More...
|
| |
|
void | disconnect () |
| | Disconnect (usually as a result of an error).
|
| |
| std::string | get_object_url (const std::string &key) |
| | Get the full URL for a given object. More...
|
| |
| 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...
|
| |
|
|
std::string | m_host |
| |
|
std::string | m_path |
| |
|
int | m_port |
| |
|
bool | m_ready_for_action = false |
| |
◆ add()
| void bcache::http_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::http_cache_provider_t::connect |
( |
const std::string & |
host_description | ) |
|
|
overridevirtual |
◆ get_data()
| std::string bcache::http_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::http_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.
◆ get_header()
| std::vector< std::string > bcache::http_cache_provider_t::get_header |
( |
const std::string & |
method, |
|
|
const std::string & |
key |
|
) |
| const |
|
privatevirtual |
Get the headers for the HTTP request.
- Parameters
-
| method | The HTTP method. |
| key | The full name of the object. |
- Returns
- a list of headers.
Reimplemented in bcache::s3_cache_provider_t.
◆ get_object_url()
| std::string bcache::http_cache_provider_t::get_object_url |
( |
const std::string & |
key | ) |
|
|
private |
Get the full URL for a given object.
- Parameters
-
| key | The full name of the object. |
- Returns
- the full URL for the object.
◆ get_path()
| std::string bcache::http_cache_provider_t::get_path |
( |
| ) |
const |
|
protected |
Get the path of the destination URL.
- Returns
- the path of the destination.
◆ is_connected()
| bool bcache::http_cache_provider_t::is_connected |
( |
| ) |
const |
|
overridevirtual |
◆ lookup()
| cache_entry_t bcache::http_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::http_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: