Examples of readOp()


Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

   
    for (int expected = firstTxnId;
        expected <= lastTxnId;
        expected++) {
     
      FSEditLogOp op = stream.readOp();
      while (op == null) {
        assertTrue("Expected to find txid " + expected + ", " +
            "but no more streams available to read from",
            iter.hasNext());
        stream = iter.next();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

      while (op == null) {
        assertTrue("Expected to find txid " + expected + ", " +
            "but no more streams available to read from",
            iter.hasNext());
        stream = iter.next();
        op = stream.readOp();
      }
     
      assertEquals(FSEditLogOpCodes.OP_MKDIR, op.opCode);
      assertEquals(expected, op.getTransactionId());
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

     
      assertEquals(FSEditLogOpCodes.OP_MKDIR, op.opCode);
      assertEquals(expected, op.getTransactionId());
    }
   
    assertNull(stream.readOp());
    assertFalse("Expected no more txns after " + lastTxnId +
        " but more streams are available", iter.hasNext());
  }
 
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

   
    for (int expected = firstTxnId;
        expected <= lastTxnId;
        expected++) {
     
      FSEditLogOp op = stream.readOp();
      while (op == null) {
        assertTrue("Expected to find txid " + expected + ", " +
            "but no more streams available to read from",
            iter.hasNext());
        stream = iter.next();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

      while (op == null) {
        assertTrue("Expected to find txid " + expected + ", " +
            "but no more streams available to read from",
            iter.hasNext());
        stream = iter.next();
        op = stream.readOp();
      }
     
      assertEquals(FSEditLogOpCodes.OP_MKDIR, op.opCode);
      assertEquals(expected, op.getTransactionId());
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

     
      assertEquals(FSEditLogOpCodes.OP_MKDIR, op.opCode);
      assertEquals(expected, op.getTransactionId());
    }
   
    assertNull(stream.readOp());
    assertFalse("Expected no more txns after " + lastTxnId +
        " but more streams are available", iter.hasNext());
  }
 
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

      // for inprogress, we can read only up to second last one
      assertEquals(numTxns - 2, stream.getLastTxId());

      verifyEdits(streams, 0, numTxns - 1, txns, true);
      assertNull(stream.readOp());
    } finally {
      IOUtils.cleanup(LOG, streams.toArray(new Closeable[0]));
      streams.clear();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

        long numOps = 0;
        long maxTxId = -1;
        FSEditLogOp op;
        long lastPos = in.getPosition();
        do {
          op = in.readOp();
          if (op == null) { // If we've reached the end prematurely...
            Thread.sleep(200);
            LOG.info("Refreshing to " + lastPos);

            in.refresh(lastPos, maxTxId); // Then refresh to last known good position
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

        // Once producer is shutdown, scan again from last known good position
        // until the end of the ledger. This mirrors the Ingest logic (last
        // read when being quiesced).
        in.refresh(lastPos, maxTxId);
        do {
          op = in.readOp();
          if (op != null) {
            long txId = op.getTransactionId();
            if (txId > maxTxId) {
              numOps++;
              maxTxId = txId;
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp()

    for (int expected = firstTxnId; expected <= lastTxnId; expected++) {
      if (inProgress) { // otherwise we cannot call refresh
        stream.refresh(position, expected - 1);
      }
      FSEditLogOp op = stream.readOp();
      position = stream.getPosition();

      while (op == null) {
        assertTrue("Expected to find txid " + expected + ", "
            + "but no more streams available to read from", iter.hasNext());
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.