Platform.Core
public static AzureEventStore OpenExistingForReading(AzureStoreConfiguration config, EventStoreId container) { var blob = config.GetPageBlob(container.Name + "/stream.dat"); var check = AzureEventPointer.OpenReadable(blob); blob.FetchAttributes(); var store = AzureEventStoreChunk.OpenExistingForReading(blob, blob.Properties.Length); return(new AzureEventStore(container, store, check)); }
public static AzureEventStore OpenExistingForWriting(AzureStoreConfiguration config, EventStoreId container) { var blob = config.GetPageBlob(container.Name + "/stream.dat"); var check = AzureEventPointer.OpenWriteable(blob); var offset = check.Read(); var length = blob.Properties.Length; var store = AzureEventStoreChunk.OpenExistingForWriting(blob, offset, length); return(new AzureEventStore(container, store, check)); }
public static AzureEventStore CreateNewForWriting(AzureStoreConfiguration config, EventStoreId container) { var blob = config.GetPageBlob(container.Name + "/stream.dat"); blob.Container.CreateIfNotExist(); var store = AzureEventStoreChunk.CreateNewForWriting(blob); var check = AzureEventPointer.OpenWriteable(blob); return(new AzureEventStore(container, store, check)); }
public AzureEventStore(EventStoreId container, AzureEventStoreChunk store, AzureEventPointer checkpoint) { Container = container; _store = store; _checkpoint = checkpoint; }