Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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()));
        }