pub struct ArrowLogStore { /* private fields */ }Expand description
One repository’s secrets, as an Arrow IPC log.
Cheap to clone: every clone is the same store, and the exclusive lock lives until the last handle is dropped.
Implementations§
Source§impl ArrowLogStore
impl ArrowLogStore
Sourcepub fn open(dir: impl AsRef<Path>, hash_kind: Kind) -> Result<Self>
pub fn open(dir: impl AsRef<Path>, hash_kind: Kind) -> Result<Self>
Open the logs in dir, creating them if absent, and take the exclusive lock.
Fails with Error::StoreLocked if another writer already holds it, and
with Error::HashKindMismatch if the log on disk belongs to a
repository of the other hash kind.
Sourcepub fn open_with_policy(
dir: impl AsRef<Path>,
hash_kind: Kind,
policy: CompactionPolicy,
) -> Result<Self>
pub fn open_with_policy( dir: impl AsRef<Path>, hash_kind: Kind, policy: CompactionPolicy, ) -> Result<Self>
ArrowLogStore::open with a chosen compaction policy.
The operator lever for threshold-based secret-log compaction. Replaced or deleted secrets are compacted immediately regardless of this policy.
Sourcepub fn in_memory(hash_kind: Kind) -> Result<(Self, MemoryLog)>
pub fn in_memory(hash_kind: Kind) -> Result<(Self, MemoryLog)>
A store with no file behind it. This is the no-OS shape, and what the no-filesystem conformance run uses.
The framing, encoding and replay code is the same as the file backing’s; what this shape cannot speak to is durability, since there is nothing for an fsync to mean. The durability claim is made by the file tests only.
Sourcepub fn open_memory(log: &MemoryLog, hash_kind: Kind) -> Result<Self>
pub fn open_memory(log: &MemoryLog, hash_kind: Kind) -> Result<Self>
Rebuild a store by replaying log, the in-memory restart.
Sourcepub fn open_memory_with_policy(
log: &MemoryLog,
hash_kind: Kind,
policy: CompactionPolicy,
) -> Result<Self>
pub fn open_memory_with_policy( log: &MemoryLog, hash_kind: Kind, policy: CompactionPolicy, ) -> Result<Self>
ArrowLogStore::open_memory with a chosen compaction policy.
Sourcepub fn force_unlock(dir: impl AsRef<Path>) -> Result<()>
pub fn force_unlock(dir: impl AsRef<Path>) -> Result<()>
Remove a lock file left behind by a process that was killed.
Only ever correct when no gunnar is running against dir. The lock is
what keeps Arrow stream appends single-writer; breaking one that is
genuinely held lets two writers interleave frames and destroy the log.
§This is no longer the normal recovery path
open reclaims a lock whose owner is provably
gone, so an appliance with no shell restarts after a power cut on its
own. What is left for this verb is the undecidable cases, where breaking
the lock is a judgement no program should make unasked: a platform with
no /proc, a lock file written by a gunnar older than the liveness
check, or one
whose owner line never reached the disk.
Sourcepub fn compaction_policy(&self) -> CompactionPolicy
pub fn compaction_policy(&self) -> CompactionPolicy
The compaction policy in force.
Sourcepub fn secrets(&self) -> ArrowLogSecretStore
pub fn secrets(&self) -> ArrowLogSecretStore
A handle implementing SecretStore.