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

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


 
  @Before
  public void setup() throws Exception {
    FileUtil.fullyDelete(TEST_LOG_DIR);
    conf = new Configuration();
    journal = new Journal(conf, TEST_LOG_DIR, JID,
      mockErrorReporter);
    journal.format(FAKE_NSINFO);
  }
View Full Code Here


    String storageString = journal.getStorage().toColonSeparatedString();
    System.err.println("storage string: " + storageString);
    journal.close(); // close to unlock the storage dir
   
    // Now re-instantiate, make sure history is still there
    journal = new Journal(conf, TEST_LOG_DIR, JID, mockErrorReporter);
   
    // The storage info should be read, even if no writer has taken over.
    assertEquals(storageString,
        journal.getStorage().toColonSeparatedString());
View Full Code Here

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

    journal.newEpoch(FAKE_NSINFO,  1);
    try {
      new Journal(conf, TEST_LOG_DIR, JID, mockErrorReporter);
      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(conf, TEST_LOG_DIR, JID, mockErrorReporter);
    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(conf, TEST_LOG_DIR, JID, mockErrorReporter);
   
    try {
      journal.finalizeLogSegment(makeRI(4), 1, 6);
      fail("did not fail to finalize");
    } catch (JournalOutOfSyncException e) {
View Full Code Here

 
  @Before
  public void setup() throws Exception {
    FileUtil.fullyDelete(TEST_LOG_DIR);
    journal = new Journal(TEST_LOG_DIR, JID, mockErrorReporter);
    journal.format(FAKE_NSINFO);
  }
View Full Code Here

    String storageString = journal.getStorage().toColonSeparatedString();
    System.err.println("storage string: " + storageString);
    journal.close(); // close to unlock the storage dir
   
    // Now re-instantiate, make sure history is still there
    journal = new Journal(TEST_LOG_DIR, JID, mockErrorReporter);
   
    // The storage info should be read, even if no writer has taken over.
    assertEquals(storageString,
        journal.getStorage().toColonSeparatedString());
View Full Code Here

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

    journal.newEpoch(FAKE_NSINFO,  1);
    try {
      new Journal(TEST_LOG_DIR, JID, mockErrorReporter);
      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, JID, mockErrorReporter);
    journal2.newEpoch(FAKE_NSINFO, 2);
  }
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, JID, mockErrorReporter);
   
    try {
      journal.finalizeLogSegment(makeRI(4), 1, 6);
      fail("did not fail to finalize");
    } catch (JournalOutOfSyncException e) {
View Full Code Here

  @Before
  public void setup() throws Exception {
    FileUtil.fullyDelete(TEST_LOG_DIR);
    FileUtil.fullyDelete(TEST_IMG_DIR);
    journal = new Journal(TEST_LOG_DIR, TEST_IMG_DIR, JID, mockErrorReporter,
        mockJournalNode);
    journal.transitionJournal(FAKE_NSINFO, Transition.FORMAT, null);
    journal.transitionImage(FAKE_NSINFO, Transition.FORMAT, null);
  }
View Full Code Here

    String storageString = journal.getJournalStorage().toColonSeparatedString();
    System.err.println("storage string: " + storageString);
    journal.close(); // close to unlock the storage dir

    // Now re-instantiate, make sure history is still there
    journal = new Journal(TEST_LOG_DIR, TEST_IMG_DIR, JID, mockErrorReporter,
        mockJournalNode);

    // The storage info should be read, even if no writer has taken over.
    assertEquals(storageString, journal.getJournalStorage().toColonSeparatedString());
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.