public static FileEventStore OpenForReading(string root, EventStoreId storeId) { var folder = Path.Combine(root, storeId.Name); var check = FileEventPointer.OpenOrCreateForReading(Path.Combine(folder, "stream.chk")); var store = FileEventStoreChunk.OpenForReading(Path.Combine(folder, "stream.dat")); return(new FileEventStore(storeId, store, check)); }
public static FileEventStore CreateNew(string root, EventStoreId storeId) { var folder = Path.Combine(root, storeId.Name); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } var check = FileEventPointer.OpenOrCreateForWriting((Path.Combine(folder, "stream.chk"))); var store = FileEventStoreChunk.CreateNew(Path.Combine(folder, "stream.dat")); return(new FileEventStore(storeId, store, check)); }
public FileEventStore(EventStoreId storeId, FileEventStoreChunk store, FileEventPointer checkpoint) { StoreId = storeId; _store = store; _checkpoint = checkpoint; }