pub struct Target {
root: PathBuf,
}Expand description
Where offloaded blocks go. Parsed from --offload.
Fields§
§root: PathBufImplementations§
Source§impl Target
impl Target
Sourcepub fn parse(uri: &str) -> Result<Target>
pub fn parse(uri: &str) -> Result<Target>
Parse an offload URI.
Everything after file:// is the path, so file:///srv/cold is
absolute and file://./cold is relative to the working directory.
There is no host field; a mounted bucket, an NFS export or a second
local volume are all the same thing to this module.
s3:// is not implemented, and the error says so rather than failing
later with something vaguer. The reason is the dependency budget the
README states as a product property: this tree has no HTTP client, no
HMAC/SHA implementation and no XML parser, and SigV4 signing plus
ListObjectsV2 response parsing needs all three. That is not an
argument that it should never exist — it is the number whoever adds it
has to be willing to move, stated where they will hit it.
Sourcepub fn list(&self, signal: &str) -> Result<Vec<BlockRef>>
pub fn list(&self, signal: &str) -> Result<Vec<BlockRef>>
Every block the store holds for signal, oldest first.
This is block::scan against the store’s root and nothing else: the
same readdir that rebuilds the local catalog at boot rebuilds the
remote one, because the two namespaces are the same namespace. If this
function needed anything the local one does not, the naming scheme
would not be carrying its weight.
Sourcepub fn push(&self, signal: &str, b: &BlockRef) -> Result<bool>
pub fn push(&self, signal: &str, b: &BlockRef) -> Result<bool>
Copy one local block into the store. false if it was already there.
Staged under .tmp and renamed, for the reason block::publish
stages: the store’s list API is the catalog, so a half-copied block
visible under its final name is a catalog entry that does not open.
“Already there” is checked against the bytes, not only the name,
because false is what licenses the caller to unlink the local copy —
block::expire_with on the retention sweep, the operator deleting a
drained replica’s volume on mira offload push exiting 0. A replica
re-created on a fresh volume keeps its node id and restarts its
sequence, so it reissues (node, seq) pairs the store may still hold,
and a name taken by somebody else’s rows is the one case where “already
archived” is a lie with a volume behind it.
Sourcepub fn pull(
&self,
signal: &str,
b: &BlockRef,
data_dir: &Path,
node: u32,
) -> Result<bool>
pub fn pull( &self, signal: &str, b: &BlockRef, data_dir: &Path, node: u32, ) -> Result<bool>
Copy one offloaded block back into a local data directory. false if
it was already there.
node only names the staging directory, so that a restore killed
half-way leaves a directory block::sweep_staging already knows how
to clear at the next start.
It lands under block::name_covering_no_log rather than the name the
store holds, because the log the stored name refers to is the one on the
volume this block is being rescued from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].