Expand description
Cluster sharding core for Datum.
This crate implements the v0.10 sharding subset: envelopes and shard
extraction, an oldest-member shard coordinator, one region per node,
first-message entity actor startup, bounded buffering while resolving
unallocated shards, rebalance-on-membership-change with bounded handoff
buffering, and peer-region forwarding over long-lived C2 DCP shard pipes
from datum-agent.
Delivery is at-most-once per attempt. Ordering is preserved for messages to
one entity from one sender that awaits each tell/ask call. There is no
persistent allocation store in v0.10. When remember-entities is enabled for
an entity type, entity ids are recorded through a write-behind
RememberEntitiesStore and are respawned when their shard starts; in-memory
entity state is not migrated. Passivation removes the entity id from the
remember store, matching Akka Cluster Sharding’s rule that passivated
entities are not remembered. Coordinator takeover rebuilds the allocation
table from surviving regions and keeps the highest generation for each shard;
any shard that still points at a non-eligible member is reallocated by the
new coordinator.
Re-exports§
pub use serde;
Structs§
- Actor
Entity Handle - Typed ingress and lifecycle controls for a spawned
ActorEntity. - Default
Shard Extractor - Hash-based default extractor: FNV-1a 64-bit
(entity_id) % num_shards. - Entity
Context - Context passed to an entity factory.
- Entity
Ref - Reference to one entity.
- File
Store - Per-shard append-log remember-entities store.
- InMemory
Store - In-memory remembered entity store.
- Rebalance
Round - One coordinator rebalance round.
- Remember
Entities Config - Remember-entities configuration for a sharding region.
- Remember
Entities Event - Shard-level remember-entities error event.
- Remember
Entities Store Error - Error returned by a
RememberEntitiesStore. - Reply
Port - Reply port for sharded asks.
- Reply
Send Error - Error returned when a sharded reply cannot be sent.
- Shard
Envelope - User-facing sharding envelope.
- Shard
Movement - One shard movement recorded by the active coordinator.
- Sharding
- Sharding entrypoint.
- Sharding
Config - Configuration for one sharding region.
- Sharding
Handle - Running sharding region handle.
- Single
Node Sharding - In-process single-node sharding host for local development and tests.
Enums§
- File
Store Fsync Policy - File-store fsync policy.
- Rebalance
Reason - Coordinator rebalance reason.
- Remember
Entities Failure Policy - Availability policy when remember-entities storage fails.
- Remember
Entities Operation - Remember-entities operation attached to a failure event.
- Sharding
Error - Errors returned by the sharding core.
Constants§
- VERSION
- The
datum-cluster-shardingcrate version.
Traits§
- Actor
Entity - Spawnable actor entity created by an
EntityContextfactory. - Entity
Behavior - Handler owned by one Ractor entity actor.
- Remember
Entities Store - Store SPI for remembered entity ids.
- Shard
Extractor - Extracts entity and shard ids, mirroring Akka’s entity/shard extractors.
Type Aliases§
- Actor
Entity Spawn Future - Future that spawns one actor-backed sharding entity.
- Remember
Entities Store Future - Future returned by
RememberEntitiesStoremethods. - Remember
Entities Store Result - Result alias for remember-entities stores.
- Sharding
Result - Result alias for
datum-cluster-sharding.