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