pub struct RedisLocalSnapshot {
pub redis_addr: SocketAddr,
pub aof_path: PathBuf,
pub timeout: Duration,
pub bgrewrite_retries: u32,
pub bgrewrite_retry_pause: Duration,
}Expand description
Default snapshot source: pulls a Redis snapshot from a local Redis instance.
The reference engine pipes the on-disk AOF file produced by
BGREWRITEAOF over the entropy channel. The Rust default
follows that contract: it issues a BGREWRITEAOF over the
configured Redis TCP endpoint, waits for the command to be
acknowledged, then reads the AOF file from disk. Embedders
that need a different snapshot strategy plug in their own
SnapshotSource through the Stage 13 API.
§Examples
use dynomite::entropy::RedisLocalSnapshot;
let source = RedisLocalSnapshot::default();
drop(source);Fields§
§redis_addr: SocketAddrAddress of the local Redis instance.
aof_path: PathBufPath to the AOF file on disk.
timeout: DurationConnect/read timeout.
bgrewrite_retries: u32Number of BGREWRITEAOF retries before giving up. The
reference engine retries once after a 10 second sleep; we
expose the count and pause as parameters.
bgrewrite_retry_pause: DurationPause between BGREWRITEAOF retries.
Implementations§
Source§impl RedisLocalSnapshot
impl RedisLocalSnapshot
Sourcepub fn with_redis_addr(self, addr: SocketAddr) -> Self
pub fn with_redis_addr(self, addr: SocketAddr) -> Self
Override the Redis address.
Sourcepub fn with_aof_path(self, path: PathBuf) -> Self
pub fn with_aof_path(self, path: PathBuf) -> Self
Override the AOF on-disk path.
Trait Implementations§
Source§impl Default for RedisLocalSnapshot
impl Default for RedisLocalSnapshot
Source§impl SnapshotSource for RedisLocalSnapshot
impl SnapshotSource for RedisLocalSnapshot
Source§fn snapshot(&self) -> EntropyResult<Vec<u8>>
fn snapshot(&self) -> EntropyResult<Vec<u8>>
SnapshotSink. Read moreAuto Trait Implementations§
impl Freeze for RedisLocalSnapshot
impl RefUnwindSafe for RedisLocalSnapshot
impl Send for RedisLocalSnapshot
impl Sync for RedisLocalSnapshot
impl Unpin for RedisLocalSnapshot
impl UnsafeUnpin for RedisLocalSnapshot
impl UnwindSafe for RedisLocalSnapshot
Blanket Implementations§
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.