Java 类org.apache.hadoop.hdfs.server.namenode.TestEditLog 实例源码

项目:hadoop    文件:QJMTestUtil.java   
/**
 * 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());
}
项目:aliyun-oss-hadoop-fs    文件:QJMTestUtil.java   
/**
 * 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());
}
项目:big-c    文件:QJMTestUtil.java   
/**
 * 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());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:QJMTestUtil.java   
/**
 * 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());
}
项目:FlexMap    文件:QJMTestUtil.java   
/**
 * 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());
}
项目:hadoop-on-lustre2    文件:QJMTestUtil.java   
/**
 * 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());
}