public Reader(DbTableStorage table, Action finalizer) { _table = table; _finalizer = finalizer; CreateStreams(); UpdateTs(); }
static DbTableStorage MoveFile(DbTableStorage table) { var backup = GetBackupName(table); if (File.Exists(backup)) { File.Delete(backup); } if (File.Exists(table._dataName)) { File.Move(table._dataName, backup); } return(table); }
static string GetBackupName(DbTableStorage table) { return(table._dataName + ".bak"); }
public Compacter(DbTableStorage table, Action finalizer) : base(MoveFile(table), finalizer) { _readStream = _table.OpenRead(GetBackupName(_table), true); }
public Writer(DbTableStorage table, Action finalizer) : base(table, finalizer) { }
static string GetBackupName(DbTableStorage table) { return table._dataName + ".bak"; }
static DbTableStorage MoveFile(DbTableStorage table) { var backup = GetBackupName(table); if (File.Exists(backup)) File.Delete(backup); if (File.Exists(table._dataName)) File.Move(table._dataName, backup); return table; }
public Compacter(DbTableStorage table, Action finalizer) : base(MoveFile(table), finalizer) { _readStream = _table.OpenRead(GetBackupName(_table)).AsBuffered(); }