pub struct FileStore { /* private fields */ }Expand description
Per-shard append-log remember-entities store.
Each shard is stored as <dir>/<hex(type_name)>/<hex(shard_id)>.log.
Starts append one record. Stops/passivation rewrite the shard log with the
remaining live entity ids, which compacts tombstones immediately. With
FileStoreFsyncPolicy::Always, each append and compaction is fsynced
before the store method returns to the write-behind worker; because writes
are still write-behind, a delivered message is acknowledged before the store
record is necessarily durable.
Implementations§
Source§impl FileStore
impl FileStore
Sourcepub const fn with_fsync_policy(self, policy: FileStoreFsyncPolicy) -> Self
pub const fn with_fsync_policy(self, policy: FileStoreFsyncPolicy) -> Self
Set the fsync policy.
Trait Implementations§
Source§impl RememberEntitiesStore for FileStore
impl RememberEntitiesStore for FileStore
Source§fn record_entity_started<'a>(
&'a self,
type_name: &'a str,
shard_id: &'a str,
entity_id: &'a str,
) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
fn record_entity_started<'a>( &'a self, type_name: &'a str, shard_id: &'a str, entity_id: &'a str, ) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
Record that
entity_id has started in type_name/shard_id.Source§fn record_entity_stopped<'a>(
&'a self,
type_name: &'a str,
shard_id: &'a str,
entity_id: &'a str,
) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
fn record_entity_stopped<'a>( &'a self, type_name: &'a str, shard_id: &'a str, entity_id: &'a str, ) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
Record that
entity_id has stopped/passivated in type_name/shard_id.Source§fn list_entities_for_shard<'a>(
&'a self,
type_name: &'a str,
shard_id: &'a str,
) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<Vec<String>>>
fn list_entities_for_shard<'a>( &'a self, type_name: &'a str, shard_id: &'a str, ) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<Vec<String>>>
Return remembered entity ids for one shard.
Source§fn list_shards<'a>(
&'a self,
type_name: &'a str,
) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<Vec<String>>>
fn list_shards<'a>( &'a self, type_name: &'a str, ) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<Vec<String>>>
Return shards known to the store for one entity type.
Source§fn flush<'a>(
&'a self,
) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
fn flush<'a>( &'a self, ) -> RememberEntitiesStoreFuture<'a, RememberEntitiesStoreResult<()>>
Synchronise outstanding writes so a resolved
RememberEntitiesRuntime::flush
makes prior starts/stops visible to a reader that opens the store after the
flush resolves (e.g., a node restart).Auto Trait Implementations§
impl Freeze for FileStore
impl RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnsafeUnpin for FileStore
impl UnwindSafe for FileStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage