Package org.apache.hadoop.hdfs.qjournal.server

Examples of org.apache.hadoop.hdfs.qjournal.server.Journal


    // Journal should be locked, since the format() call locks it.
    GenericTestUtils.assertExists(lockFile);

    journal.newEpoch(FAKE_NSINFO, 1);
    try {
      new Journal(TEST_LOG_DIR, TEST_IMG_DIR, JID, mockErrorReporter, mockJournalNode);
      fail("Did not fail to create another journal in same dir");
    } catch (IOException ioe) {
      GenericTestUtils.assertExceptionContains("Cannot lock storage", ioe);
    }

    journal.close();

    // Journal should no longer be locked after the close() call.
    // Hence, should be able to create a new Journal in the same dir.
    Journal journal2 = new Journal(TEST_LOG_DIR, TEST_IMG_DIR, JID,
        mockErrorReporter, mockJournalNode);
    journal2.newEpoch(FAKE_NSINFO, 2);
    journal2.close();
  }
View Full Code Here


    }

    // Check that, even if we re-construct the journal by scanning the
    // disk, we don't allow finalizing incorrectly.
    journal.close();
    journal = new Journal(TEST_LOG_DIR, TEST_IMG_DIR, JID, mockErrorReporter,
        mockJournalNode);

    try {
      journal.finalizeLogSegment(makeRI(4), 1, 6);
      fail("did not fail to finalize");
View Full Code Here

    // assert that each file contains what it should
    for (int i = 0; i < numJournals; i++) {
      if (h.failOn[i] != null) {
        continue;
      }
      Journal j = cluster.getJournalNode(i).getOrCreateJournal(JID.getBytes());
      assertContentsForJournal(j, written, txid);
    }

    // for failures assert the number of exceptions
    int expectedExceptionCount = 0;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.qjournal.server.Journal

Copyright © 2018 www.massapicom. 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.