Package org.apache.hadoop.hdfs.qjournal.protocol

Examples of org.apache.hadoop.hdfs.qjournal.protocol.RequestInfo


  @Test
  public void testMaintainCommittedTxId() throws Exception {
    journal.newEpoch(FAKE_NSINFO, 1);
    journal.startLogSegment(makeRI(1), 1);
    // Send txids 1-3, with a request indicating only 0 committed
    journal.journal(new RequestInfo(JIDB, 1, 2, 0), 1, 1, 3,
        QJMTestUtil.createTxnData(1, 3));
    assertEquals(0, journal.getCommittedTxnId());

    // Send 4-6, with request indicating that through 3 is committed.
    journal.journal(new RequestInfo(JIDB, 1, 3, 3), 1, 4, 3,
        QJMTestUtil.createTxnData(4, 6));
    assertEquals(3, journal.getCommittedTxnId());
  }
View Full Code Here


  }

  @Test
  public void testFormatResetsCachedValues() throws Exception {
    journal.newEpoch(FAKE_NSINFO, 12345L);
    journal.startLogSegment(new RequestInfo(JIDB, 12345L, 1L, 0L), 1L);

    assertEquals(12345L, journal.getLastPromisedEpoch());
    assertEquals(12345L, journal.getLastWriterEpoch());
    assertTrue(journal.isJournalFormatted());
View Full Code Here

    TestCase.assertEquals(0, journal.getEditLogManifest(Long.MIN_VALUE).getLogs().size());
    TestCase.assertEquals(0, journal.getCommittedTxnId());
  }

  private static RequestInfo makeRI(int serial) {
    return new RequestInfo(JIDB, 1, serial, 0);
  }
View Full Code Here

    }
  }

  private synchronized RequestInfo createReqInfo() {
    checkEpoch();
    return new RequestInfo(journalIdBytes, epoch, ipcSerial++,
        committedTxId);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.qjournal.protocol.RequestInfo

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.