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 more