Examples of EditLogFileOutputStream


Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

   * Create a processor that writes to a given file
   *
   * @param filename Name of file to write output to
   */
  public BinaryEditsVisitor(String outputName) throws IOException {
    this.elfos = new EditLogFileOutputStream(new File(outputName), 0);
    elfos.create();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

  /**
   * Create a processor that writes to a given file
   * @param outputName Name of file to write output to
   */
  public BinaryEditsVisitor(String outputName) throws IOException {
    this.elfos = new EditLogFileOutputStream(new Configuration(),
      new File(outputName), 0);
    elfos.create(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

   * Create a processor that writes to a given file
   *
   * @param filename Name of file to write output to
   */
  public BinaryEditsVisitor(String outputName) throws IOException {
    this.elfos = new EditLogFileOutputStream(new Configuration(),
      new File(outputName), 0);
    elfos.create();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

   * Create a processor that writes to a given file
   *
   * @param filename Name of file to write output to
   */
  public BinaryEditsVisitor(String outputName) throws IOException {
    this.elfos = new EditLogFileOutputStream(new File(outputName), 0);
    elfos.create();
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

   * Create a processor that writes to a given file
   *
   * @param filename Name of file to write output to
   */
  public BinaryEditsVisitor(String outputName) throws IOException {
    this.elfos = new EditLogFileOutputStream(new Configuration(),
      new File(outputName), 0);
    elfos.create(NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

    File edits = getFileWithCurrent(editsDir, "edits");
    File fstime = getFileWithCurrent(editsDir, "fstime");

    if (!edits.createNewFile())
      throw new IOException("Failed to create edits file");
    EditLogFileOutputStream out = new EditLogFileOutputStream(edits, null);
    out.create();
    if (!fstime.createNewFile())
      throw new IOException("Failed to create fstime file");
   
    return out;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

    File editsNew = getFileWithCurrent(editsDir, "edits.new");

    editsOutput.close();
    if (!editsNew.createNewFile())
      throw new IOException("Failed to create edits.new file");
    EditLogFileOutputStream out = new EditLogFileOutputStream(editsNew, null);
    out.create();
    Assert.assertTrue(editsNew.exists());

    return out;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

 
  @Test
  public void testOneOperation() throws Exception {
    File editsDir = createEditsDir();
    DummyServerCore core = new DummyServerCore();
    EditLogFileOutputStream out = initEdits(editsDir);
    ServerLogReaderPreTransactional logReader = new ServerLogReaderPreTransactional(core,
        Util.stringAsURI(editsDir.getAbsolutePath()));
    core.logReader = logReader;
    Thread coreThread, logReaderThread;
   
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

 
  @Test
  public void testMultipleOperations() throws Exception {
    File editsDir = createEditsDir();
    DummyServerCore core = new DummyServerCore();
    EditLogFileOutputStream out = initEdits(editsDir);
    ServerLogReaderPreTransactional logReader = new ServerLogReaderPreTransactional(core,
        Util.stringAsURI(editsDir.getAbsolutePath()));
    core.logReader = logReader;
    Thread coreThread, logReaderThread;
    long txCount = 1000;
   
    coreThread = new Thread(core);
    logReaderThread = new Thread(logReader);
   
    logReaderThread.start();
    coreThread.start();
    for (long txId = 0; txId < txCount; txId ++) {
      writeOperation(out, txId, false);
    }
   
    // flush
    out.setReadyToFlush();
    out.flush();
   
    Thread.sleep(500);
    core.shutdown();
    logReaderThread.join();
    coreThread.join();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream

 
  @Test
  public void testTwoOperationsRoll() throws Exception {
    File editsDir = createEditsDir();
    DummyServerCore core = new DummyServerCore();
    EditLogFileOutputStream out = initEdits(editsDir);
    ServerLogReaderPreTransactional logReader = new ServerLogReaderPreTransactional(core,
        Util.stringAsURI(editsDir.getAbsolutePath()));
    core.logReader = logReader;
    Thread coreThread, logReaderThread;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.