Expand description
Riak-compatible protocol layer for the Dynomite Rust port.
dyniak is an optional layer that operators can put in front of
the Dynomite cluster substrate to expose a Riak client API. The
crate is intentionally narrow: it owns only the Riak-specific
pieces (wire codec, request dispatch, storage bridge) and reuses
the substrate already shipped in crates/dynomite/ (hashing,
gossip, vnodes, quorum, dispatch).
§Public surface
proto::pb– the Riak Protocol Buffers wire format. Hand-rolledprost::Messagestructs for the v0.0.1 operation set (proto::pb::RpbPingReq/proto::pb::RpbPingResp,proto::pb::RpbGetReq/proto::pb::RpbGetResp,proto::pb::RpbPutReq/proto::pb::RpbPutResp,proto::pb::RpbDelReq) plus an error response. The framing layer is exposed throughproto::pb::framer.server::serve_pbc– TCP accept loop that reads PBC frames, dispatches each request to adynomite::embed::Datastore, and writes framed replies.server::handle_conn– the per-connection driver. Generic overtokio::io::AsyncRead/tokio::io::AsyncWriteso tests can drive it throughtokio::io::duplexwithout a real socket.error::RiakError– the crate’s top-level error type.- [
datastore::NoxuDatastore] – gated behind thenoxuCargo feature; bridges this crate to the in-process Noxu DB storage engine. serve_http_with_search– gated behind thesearchCargo feature; serves the HTTP gateway with adynomite_search::VectorRegistrywired in, lighting up the per-bucket text (substring + approximate-regex) and vector-KNN index-management and search routes. Without the feature, or without a registry, those routes reply501 Not Implementedand the object / list / transaction surface is unchanged.
§Architecture
TCP listener (tokio::net::TcpListener)
|
v
serve_pbc() -- accept loop, spawns one task per conn
|
v
handle_conn(stream, datastore)
- decode 4-byte BE length
- decode 1-byte msg code
- decode protobuf body via prost
- dispatch through dynomite::embed::Datastore
- encode response via prost
- write framed response§Encoding
The PBC path is hard-coded to application/x-protobuf; the bytes
travel through a dyn_encoding::ProtobufCodec wired up in
proto::pb::codec_registry. The HTTP gateway (serve_http)
negotiates JSON / CBOR / protobuf per-request through the same
registry.
Re-exports§
pub use crate::error::RiakError;pub use crate::proto::http::serve_http;pub use crate::proto::http::serve_http_tls;pub use crate::proto::http::serve_http_tls_with_routing;pub use crate::proto::http::serve_http_with_routing;pub use crate::server::handle_conn;pub use crate::server::serve_pbc;pub use crate::server::serve_pbc_tls;pub use crate::server::handle_conn_with_admin;pub use crate::server::serve_pbc_tls_with_admin;pub use crate::server::serve_pbc_with_admin;pub use crate::server::handle_conn_with_hooks;pub use crate::server::serve_pbc_with_routing;pub use crate::server::handle_conn_with_aae_status;pub use crate::server::serve_pbc_with_aae_status;pub use crate::bucket_props::BucketProps;pub use crate::bucket_props::BucketPropsRegistry;pub use crate::replica_apply::ReplicaApplier;pub use crate::replication::plan_replicas;pub use crate::replication::plan_replicas_with_liveness;pub use crate::replication::ReplicaLiveness;pub use crate::replication::ReplicationPlan;pub use crate::replication::ReplicationStrategy;pub use crate::replication::ReplicationStrategyError;pub use crate::replication::RingPoint;pub use crate::replication::RingView;pub use crate::router::BucketRouter;pub use crate::router::PeerOp;pub use crate::router::PeerOutbound;pub use crate::router::RouteDecision;pub use crate::router::RoutingHooks;pub use crate::txn::TransactionalStore;pub use crate::txn::TxnBatch;pub use crate::txn::TxnOp;pub use crate::txn::TxnOutcome;pub use crate::txn::TxnStoreError;pub use crate::ramp::select;pub use crate::ramp::RampClock;pub use crate::ramp::RampItem;pub use crate::ramp::Timestamp;
Modules§
- aae
- Tictac active anti-entropy (AAE).
- bucket_
props - Per-bucket-type, per-bucket property cache.
- crdt_
store - Convergent CRDT apply against the local datastore.
- datastore
- Storage bridges for the Riak protocol layer.
- datatypes
- Riak CRDT data types.
- error
- Top-level error type for the
dyniakcrate. - handoff
- Explicit token-range handoff between peers.
- mapreduce
- MapReduce (“pipes”) for the Riak compatibility layer.
- proto
- Riak wire protocols.
- quorum
- Quorum resolution for Riak-style tunable consistency.
- ramp
- Read-Atomic Multi-Partition (RAMP) transactions.
- reaper
- TTL-driven sibling and tombstone garbage collection.
- replica_
apply - Local application of inbound cross-node object-replica ops.
- replication
- Walk-N-successors replication planning for Riak buckets.
- router
- Bucket-aware request router.
- server
- TCP accept loop and per-connection driver for the Riak PBC transport.
- txn
- Multi-key transaction surface for the Riak protocol layer.
- vclock
- Per-object causal context as a dotted version vector.