예제 #1
0
 /// <exception cref="System.IO.IOException"/>
 internal static void AddDeleteOpcode(EditLogOutputStream elos, FSEditLogOp.OpInstanceCache
                                      cache, long txId, string path)
 {
     FSEditLogOp.DeleteOp op = FSEditLogOp.DeleteOp.GetInstance(cache);
     op.SetTransactionId(txId);
     op.SetPath(path);
     op.SetTimestamp(0);
     elos.Write(op);
 }
예제 #2
0
 /// <exception cref="System.IO.IOException"/>
 public override void AddTransactionsToLog(EditLogOutputStream elos, FSEditLogOp.OpInstanceCache
                                           cache)
 {
     for (long txid = 1; txid <= MaxTxid; txid++)
     {
         if (txid == BadTxid)
         {
             byte[] garbage = new byte[] { unchecked ((int)(0x1)), unchecked ((int)(0x2)), unchecked (
                                               (int)(0x3)) };
             elos.WriteRaw(garbage, 0, garbage.Length);
         }
         else
         {
             FSEditLogOp.DeleteOp op;
             op = FSEditLogOp.DeleteOp.GetInstance(cache);
             op.SetTransactionId(txid);
             op.SetPath("/foo." + txid);
             op.SetTimestamp(txid);
             elos.Write(op);
         }
     }
 }