pub struct CachedFile {
pub path: String,
pub name: String,
pub uploaded: bool,
pub cached: bool,
}Expand description
A worker binary on the cluster, as Client::upload_worker_cached left it.
Fields§
§path: StringCypress path to reference from a spec.
name: StringThe name to give it in the job’s sandbox.
The cached node is named after the file’s hash, so a command like
./my_job needs this passed to
MapSpec::with_local_file_named.
uploaded: boolWhether this call had to upload it. false is a cache hit.
cached: boolWhether CachedFile::path is inside the shared file cache.
true for a cache hit and for an upload the cache accepted; false
only when the cache refused this caller and the worker went up under
//tmp instead — see Client::upload_worker_cached.
This is the field to branch on before removing anything. The two
are not the same question and neither answers the other: uploaded
alone says the bytes were sent, which is true of both destinations, so
a caller that tidies up after itself on that signal deletes the shared
cache entry on an ordinary cluster and evicts the binary for everyone
else. A caller that never tidies up leaks a node per launch on the
cluster where this is false, since nothing expires //tmp uploads —
which is the other half of why the fallback warns.
Trait Implementations§
Source§impl Clone for CachedFile
impl Clone for CachedFile
Source§fn clone(&self) -> CachedFile
fn clone(&self) -> CachedFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more