/** * Generate byte array representing a set of GarbageMkdirOp */ public static byte[] createGabageTxns(long startTxId, int numTxns) throws IOException { DataOutputBuffer buf = new DataOutputBuffer(); FSEditLogOp.Writer writer = new FSEditLogOp.Writer(buf); for (long txid = startTxId; txid < startTxId + numTxns; txid++) { FSEditLogOp op = new TestEditLog.GarbageMkdirOp(); op.setTransactionId(txid); writer.writeOp(op); } return Arrays.copyOf(buf.getData(), buf.getLength()); }