Skip to content

GrainStateWithMetaData<TView> Properties

A class that extends grain state with versioning metadata, so that a log-consistent grain can use a standard storage provider.

State

getset
View source
[Orleans.Id(0)]
public TView State
The stored view of the log

WriteVector

getset
View source
[Orleans.Id(2)]
public string WriteVector
Metadata that is used to avoid duplicate appends. Logically, this is a (string->bit) map, the keys being replica ids But this map is represented compactly as a simple string to reduce serialization/deserialization overhead Bits are read by Orleans.EventSourcing.StateStorage.GrainStateWithMetaData.GetBit and flipped by Orleans.EventSourcing.StateStorage.GrainStateWithMetaData.FlipBit. Bits are toggled when writing, so that the retry logic can avoid appending an entry twice when retrying a failed append.