Example #1
0
 public Reader(DbTableStorage table, Action finalizer)
 {
     _table     = table;
     _finalizer = finalizer;
     CreateStreams();
     UpdateTs();
 }
Example #2
0
            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);
            }
Example #3
0
 static string GetBackupName(DbTableStorage table)
 {
     return(table._dataName + ".bak");
 }
Example #4
0
 public Compacter(DbTableStorage table, Action finalizer)
     : base(MoveFile(table), finalizer)
 {
     _readStream = _table.OpenRead(GetBackupName(_table), true);
 }
Example #5
0
 public Writer(DbTableStorage table, Action finalizer)
     : base(table, finalizer)
 {
 }