Skip to main content

Crate datum_cluster_sharding

Crate datum_cluster_sharding 

Source
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§

ActorEntityHandle
Typed ingress and lifecycle controls for a spawned ActorEntity.
DefaultShardExtractor
Hash-based default extractor: FNV-1a 64-bit (entity_id) % num_shards.
EntityContext
Context passed to an entity factory.
EntityRef
Reference to one entity.
FileStore
Per-shard append-log remember-entities store.
InMemoryStore
In-memory remembered entity store.
RebalanceRound
One coordinator rebalance round.
RememberEntitiesConfig
Remember-entities configuration for a sharding region.
RememberEntitiesEvent
Shard-level remember-entities error event.
RememberEntitiesStoreError
Error returned by a RememberEntitiesStore.
ReplyPort
Reply port for sharded asks.
ReplySendError
Error returned when a sharded reply cannot be sent.
ShardEnvelope
User-facing sharding envelope.
ShardMovement
One shard movement recorded by the active coordinator.
Sharding
Sharding entrypoint.
ShardingConfig
Configuration for one sharding region.
ShardingHandle
Running sharding region handle.
SingleNodeSharding
In-process single-node sharding host for local development and tests.

Enums§

FileStoreFsyncPolicy
File-store fsync policy.
RebalanceReason
Coordinator rebalance reason.
RememberEntitiesFailurePolicy
Availability policy when remember-entities storage fails.
RememberEntitiesOperation
Remember-entities operation attached to a failure event.
ShardingError
Errors returned by the sharding core.

Constants§

VERSION
The datum-cluster-sharding crate version.

Traits§

ActorEntity
Spawnable actor entity created by an EntityContext factory.
EntityBehavior
Handler owned by one Ractor entity actor.
RememberEntitiesStore
Store SPI for remembered entity ids.
ShardExtractor
Extracts entity and shard ids, mirroring Akka’s entity/shard extractors.

Type Aliases§

ActorEntitySpawnFuture
Future that spawns one actor-backed sharding entity.
RememberEntitiesStoreFuture
Future returned by RememberEntitiesStore methods.
RememberEntitiesStoreResult
Result alias for remember-entities stores.
ShardingResult
Result alias for datum-cluster-sharding.