/// <exception cref="System.IO.IOException"/> public static void WriteOp(EditLogOutputStream stm, long txid) { FSEditLogOp op = NameNodeAdapter.CreateMkdirOp("tx " + txid); op.SetTransactionId(txid); stm.Write(op); }
/// <exception cref="System.Exception"/> public static byte[] CreateTxnData(int startTxn, int numTxns) { DataOutputBuffer buf = new DataOutputBuffer(); FSEditLogOp.Writer writer = new FSEditLogOp.Writer(buf); for (long txid = startTxn; txid < startTxn + numTxns; txid++) { FSEditLogOp op = NameNodeAdapter.CreateMkdirOp("tx " + txid); op.SetTransactionId(txid); writer.WriteOp(op); } return(Arrays.CopyOf(buf.GetData(), buf.GetLength())); }