Examples of readOp()


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(expected, op.getTransactionId());
      assertEquals(expected, writtenTxns.get(expected).getTransactionId());
      assertEquals(op.opCode, writtenTxns.get(expected).opCode);
View Full Code Here

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

      assertEquals(expected, op.getTransactionId());
      assertEquals(expected, writtenTxns.get(expected).getTransactionId());
      assertEquals(op.opCode, writtenTxns.get(expected).opCode);
    }

    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()

      EditLogInputStream stream = streams.get(0);
      assertEquals(1, stream.getFirstTxId());
      assertEquals(3, stream.getLastTxId());
     
      verifyEdits(streams, 1, 3);
      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()

    qjm.selectInputStreams(streams, 0, true, false);
   
    long lastReadTxId = -1;
    EditLogInputStream is = streams.get(0);
    for (int i = 0; i < 3; i++) {
      FSEditLogOp op = is.readOp();
      assertNotNull(op);
      lastReadTxId = op.getTransactionId();
      LOG.info("Read transaction: " + op + " with txid: "
          + op.getTransactionId());
    }
View Full Code Here

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

    } // expected
   
    // reads should fall back to another stream
    LOG.info("We should be able to read from the stream");
    for (int i = 0; i < 3; i++) {
      FSEditLogOp op = is.readOp();
      assertNotNull(op);
      assertEquals(++lastReadTxId, op.getTransactionId());
      LOG.info("Read transaction: " + op + " with txid: "
          + op.getTransactionId());
      position = is.getPosition();
View Full Code Here

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

      EditLogInputStream stream = streams.get(0);
      assertEquals(0, stream.getFirstTxId());
      assertEquals(numTxns - 1, stream.getLastTxId());

      verifyEdits(streams, 0, numTxns - 1, txns, false);
      assertNull(stream.readOp());
    } finally {
      IOUtils.cleanup(LOG, streams.toArray(new Closeable[0]));
      streams.clear();
    }
  }
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.