pub struct CheckpointManager { /* private fields */ }Expand description
Manages checkpoints for metrics storage
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub async fn new(config: CheckpointConfig) -> Result<Self, Status>
pub async fn new(config: CheckpointConfig) -> Result<Self, Status>
Create a new checkpoint manager (standalone mode)
This creates a local git repository that is not tracked in any registry.
For shared registry integration, use new_with_client() instead.
Sourcepub async fn new_with_client(
client: Arc<dyn RegistryClient>,
repo_name: &str,
config: CheckpointConfig,
) -> Result<Self, Status>
pub async fn new_with_client( client: Arc<dyn RegistryClient>, repo_name: &str, config: CheckpointConfig, ) -> Result<Self, Status>
Create a new checkpoint manager with shared registry client
The checkpoint repository will be registered in the shared registry, allowing it to be discovered and managed alongside other repositories.
§Arguments
client- Shared registry clientrepo_name- Name for the checkpoint repository (e.g., “metrics-checkpoints”)config- Checkpoint configuration
Sourcepub async fn create_checkpoint(
&self,
storage: &DuckDbBackend,
name: Option<String>,
) -> Result<Checkpoint, Status>
pub async fn create_checkpoint( &self, storage: &DuckDbBackend, name: Option<String>, ) -> Result<Checkpoint, Status>
Create a checkpoint from the current storage state
Sourcepub async fn restore(
&self,
checkpoint_id: &str,
storage: &DuckDbBackend,
) -> Result<(), Status>
pub async fn restore( &self, checkpoint_id: &str, storage: &DuckDbBackend, ) -> Result<(), Status>
Restore from a checkpoint
Sourcepub async fn get_latest_checkpoint(&self) -> Option<Checkpoint>
pub async fn get_latest_checkpoint(&self) -> Option<Checkpoint>
Get the latest checkpoint
Sourcepub async fn list_checkpoints(&self) -> Vec<Checkpoint>
pub async fn list_checkpoints(&self) -> Vec<Checkpoint>
List all checkpoints
Sourcepub fn start_background(
self: Arc<Self>,
storage: Arc<DuckDbBackend>,
) -> JoinHandle<()>
pub fn start_background( self: Arc<Self>, storage: Arc<DuckDbBackend>, ) -> JoinHandle<()>
Start background checkpoint task
Sourcepub fn config(&self) -> &CheckpointConfig
pub fn config(&self) -> &CheckpointConfig
Get the configuration
Sourcepub fn registry_client(&self) -> Option<&Arc<dyn RegistryClient>>
pub fn registry_client(&self) -> Option<&Arc<dyn RegistryClient>>
Get the registry client if using shared registry
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CheckpointManager
impl !RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnsafeUnpin for CheckpointManager
impl !UnwindSafe for CheckpointManager
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync 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
Mutably borrows from an owned value. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more