tsoracle-driver-openraft 0.1.2

openraft-backed ConsensusDriver for tsoracle
Documentation

openraft-backed ConsensusDriver for tsoracle.

This crate replicates the TSO high-water mark across an openraft cluster and exposes the result via the [tsoracle_consensus::ConsensusDriver] trait. The caller supplies a pre-built [openraft::Raft] handle (with its own RaftNetworkFactory and RaftLogStorage); this crate provides the RaftTypeConfig, the log-entry type, the [HighWaterStateMachine] with a pluggable [SnapshotStore] (defaulting to in-memory, with an optional RocksdbSnapshotStore behind the rocksdb-snapshot-store feature), and the trait bridge.

Layering

  • [log_entry] defines the single command type replicated through the log.
  • [state_machine] implements openraft::storage::RaftStateMachine over an in-memory u64 counter with bincode snapshots.
  • [type_config] declares the RaftTypeConfig via tsoracle_openraft_toolkit::declare_raft_types_ext!.
  • [host] declares the OpenraftHighWaterHost trait services implement to plug their consensus into the driver.
  • [standalone] supplies the bundled host that owns its own raft cluster and the [HighWaterStateMachine].
  • [driver] wraps the Raft handle and the state machine into the ConsensusDriver impl.