public AzureEventStoreClient(AzureStoreConfiguration config, EventStoreId storeId, string serverEndpoint = null) : base(storeId, serverEndpoint) { Config = config; _blob = config.GetPageBlob(storeId.Name + "/stream.dat"); _blob.Container.CreateIfNotExist(); }
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 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 void Handle(ClientMessage.ImportEvents msg) { Log.Info("Got import request for {0} bytes", msg.Size); var watch = Stopwatch.StartNew(); var count = 0; var size = 0; var blob = _config.GetPageBlob(msg.StagingLocation); _manager.AppendEventsToStore(msg.StoreId, msg.StreamId, EnumerateStaging(blob, msg.Size).Select(bytes => { count += 1; size += bytes.Length; return(bytes); })); var totalSeconds = watch.Elapsed.TotalSeconds; var speed = size / totalSeconds; Log.Info("Import {0} in {1}sec: {2} m/s or {3}", count, Math.Round(totalSeconds, 4), Math.Round(count / totalSeconds), FormatEvil.SpeedInBytes(speed)); msg.Envelope(new ClientMessage.ImportEventsCompleted()); ThreadPool.QueueUserWorkItem(state => CleanupBlob(blob)); }
public static bool IsValid(AzureStoreConfiguration config, EventStoreId container) { var store = config.GetPageBlob(container.Name + "/stream.dat"); return Exists(store); }
public static bool IsValid(AzureStoreConfiguration config, EventStoreId container) { var store = config.GetPageBlob(container.Name + "/stream.dat"); return(Exists(store)); }