object-log 0.4.0

A buffered, multiplexing append log over pluggable object storage, with a sequencing seam (opaque payloads, durable-on-return writes, group-commit).
Documentation
//! A buffered, multiplexing append log over pluggable object storage.
//!
//! object-log stores an ordered, offset-addressed log as immutable objects in any
//! [`BlobStore`] (memory, local filesystem, or — behind a feature — S3). It deals
//! only in **opaque payload bytes**: it knows nothing about record formats, Kafka,
//! or brokers. Three pieces:
//!
//! - [`BlobStore`] — the storage *port*: durable-on-return `put`, `get`,
//!   `get_range`, `list`, `delete`. Adapters [`MemoryBlobStore`] and
//!   [`LocalBlobStore`] ship in-crate.
//! - [`Sequencer`] — the *sequencing seam*: assigns offsets to durably-stored
//!   batches and owns the offset→location index. [`InMemorySequencer`] ships
//!   in-crate; a consumer plugs its own (e.g. a Kafka coordinator) and the engine
//!   forwards each sequencer's [`Sequencer::Meta`] uninterpreted.
//! - [`LogEngine`] — buffers and group-commits many batches into one object, PUTs
//!   it durably, then calls the sequencer, so PUT count is decoupled from produce
//!   count. [`LogEngine::produce`] resolves at a requested [`Durability`].
//!
//! # Example
//!
//! ```
//! use object_log::{Durability, FlushConfig, InMemorySequencer, LogEngine, MemoryBlobStore, PartitionKey};
//! use bytes::Bytes;
//! use std::sync::Arc;
//!
//! # tokio::runtime::Runtime::new().unwrap().block_on(async {
//! let engine = LogEngine::new(
//!     Arc::new(MemoryBlobStore::new()),
//!     Arc::new(InMemorySequencer::new()),
//!     FlushConfig::default(),
//!     "log/",
//! );
//! let p = PartitionKey("events-0".into());
//!
//! let out = engine
//!     .produce(p.clone(), Bytes::from_static(b"hello"), 1, (), Durability::Sequenced)
//!     .await
//!     .unwrap();
//! assert_eq!(out.base_offset, Some(0));
//!
//! let batches = engine.fetch(&p, 0, 1024).await.unwrap();
//! assert_eq!(batches[0].payload, "hello");
//! # });
//! ```
#![deny(missing_docs)]

mod blob;
mod budget;
mod engine;
mod error;
mod manifest_sequencer;
#[cfg(any(test, feature = "native"))]
mod native_v2;
#[cfg(feature = "s3")]
mod s3;
mod sequencer;

pub use blob::{
    BlobStore, BoundedMetadataStore, CasOutcome, LocalBlobStore, MediaOpStats, MemoryBlobStore,
    MetadataLimits, MetadataOwners, MetadataSnapshot, MetadataSwap,
};
pub use budget::{BudgetConfig, BudgetMode, EffectiveKnob, EffectiveReason, PipelineSnapshot};
pub use engine::{
    AppendOutcome, AppendOwner, BufferStats, Durability, FetchedBatch, FlushConfig, LogEngine,
    reap_orphans,
};
mod bounded_fetch;
mod bounded_lookup;
pub use bounded_fetch::FetchPlan;
pub use bounded_lookup::BoundedSequencer;
pub use error::ObjectLogError;
pub use manifest_sequencer::{IndexSnapshot, ManifestSequencer, PartitionSnapshot};
#[cfg(feature = "s3")]
pub use s3::{S3BlobStore, S3ClientOptions};
pub use sequencer::{
    AuthoritativePartitionState, BatchLocation, CommitBatch, CommitOutcome,
    ConditionalCommitOutcome, InMemorySequencer, IndexEntry, PartitionKey, Sequencer,
};

#[cfg(feature = "native")]
pub use native_v2::facade::{
    NativeAppend, NativeEditLimits, NativeLimits, NativeLog, NativeNamespace, NativePublication,
    NativePublishOutcome, NativeReadCut, NativeReadPlan, NativeReadRequirements, NativeRecord,
    NativeResolution, NativeScanLimits, NativeScanStatus, NativeSemanticContinuation,
    NativeSemanticEdit, NativeSemanticRange, NativeSemanticRow, NativeSemanticScan,
    NativeSemanticValue, NativeSemanticWork, NativeWriter,
};
#[cfg(feature = "native")]
pub use native_v2::head::NativeHead;