mars-server · store::sharded_memory
Public declarations and documentation for mars-server::store::sharded_memory.
Package: mars-server · Workspace version: 0.1.0 · Module: store::sharded_memory
This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.
Module condition
#[cfg(feature = "sharding")]store::sharded_memory::ShardedMemoryStore
In-memory sharded storage that distributes entries across multiple
[MemoryStore] instances via consistent hashing.
#[cfg(feature = "sharding")]
pub struct ShardedMemoryStore {
}Source line: 26.
store::sharded_memory::ShardedMemoryStore::new
Create a new sharded memory store.
shard_ids must have at least one entry. virtual_nodes_per_shard
controls the number of ring positions per shard (typical: 150).
#[cfg(feature = "sharding")]
pub fn new(
shard_ids: &[String],
virtual_nodes_per_shard: u32,
affinity: AffinityFunction,
) -> Self;Source line: 42.
store::sharded_memory::ShardedMemoryStore::put_entry_routed
Put an entry into the appropriate shard based on affinity routing.
#[cfg(feature = "sharding")]
pub async fn put_entry_routed(&self, entry: MarsEntry) -> Result<String, ServerError>;Source line: 61.
store::sharded_memory::ShardedMemoryStore::get_store
Get the per-shard store for direct access.
#[cfg(feature = "sharding")]
pub fn get_store(&self, shard_id: &str) -> Option<&Arc<MemoryStore>>;Source line: 71.
store::sharded_memory::ShardedMemoryStore::total_entries
Total entries across all shards.
#[cfg(feature = "sharding")]
pub fn total_entries(&self) -> usize;Source line: 76.
Source provenance
Source: mars-server/src/store/sharded_memory.rs · SHA-256 1e826c05d48f1ececa5d76854db1b7459499bf98217667a1c952630f0f87fe81. Package overview.