GrainStateWithMetaData<TView>
class
Namespace: Orleans.EventSourcing.StateStorage
A class that extends grain state with versioning metadata, so that a log-consistent grain can use a standard storage provider.
[Orleans.GenerateSerializer]public sealed class GrainStateWithMetaData<TView> where TView : class, new()Constructors
GrainStateWithMetaData<TView>Initializes a new instance of theOrleans.EventSourcing.StateStorage.GrainStateWithMetaDataclass.GrainStateWithMetaData<TView>(TView)Initializes a new instance of theOrleans.EventSourcing.StateStorage.GrainStateWithMetaDataclass.
Properties
GlobalVersionThe length of the logStateThe stored view of the logWriteVectorMetadata 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 byOrleans.EventSourcing.StateStorage.GrainStateWithMetaData.GetBitand flipped byOrleans.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.
Methods
FlipBit(string)toggle one of the bits inOrleans.EventSourcing.StateStorage.GrainStateWithMetaData.WriteVectorand return the new value.GetBit(string)Gets one of the bits inOrleans.EventSourcing.StateStorage.GrainStateWithMetaData.WriteVector
