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

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


        editsDir.getAbsolutePath());
    conf.set(JournalConfigKeys.DFS_JOURNALNODE_RPC_ADDRESS_KEY,
        "0.0.0.0:0");   
    MiniJournalCluster.getFreeHttpPortAndUpdateConf(conf, true);
   
    jn = new JournalNode();
    jn.setConf(conf);
    jn.start();
    journalId = "test-journalid-" + QJMTestUtil.uniqueSequenceId();
    journal = jn.getOrCreateJournal(QuorumJournalManager
        .journalIdStringToBytes(journalId));
View Full Code Here


  }

  private static void assertJNFailsToStart(Configuration conf,
      String errString) {
    try {
      JournalNode jn = new JournalNode();
      jn.setConf(conf);
      jn.start();
    } catch (Exception e) {
      GenericTestUtils.assertExceptionContains(errString, e);
    }
  }
View Full Code Here

      if (b.format) {
        File dir = getStorageDir(i);
        LOG.debug("Fully deleting JN directory " + dir);
        FileUtil.fullyDelete(dir);
      }
      nodes[i] = new JournalNode();
      nodes[i].setConf(createConfForNode(b, i, httpPorts[i]));
      nodes[i].start();

      ipcAddrs[i] = nodes[i].getBoundIpcAddress();
      httpAddrs[i] = nodes[i].getBoundHttpAddress();
View Full Code Here

    conf.set(JournalConfigKeys.DFS_JOURNALNODE_RPC_ADDRESS_KEY, "127.0.0.1:" +
        ipcAddrs[i].getPort());
    conf.set(JournalConfigKeys.DFS_JOURNALNODE_HTTP_ADDRESS_KEY, "127.0.0.1:" +
        httpAddrs[i].getPort());
   
    JournalNode jn = new JournalNode();
    jn.setConf(conf);
    jn.start();
  }
View Full Code Here

    try {
      URI uri = c.getQuorumJournalURI("myjournal");
      String[] addrs = uri.getAuthority().split(";");
      assertEquals(3, addrs.length);
     
      JournalNode node = c.getJournalNode(0);
      String dir = node.getConf().get(JournalConfigKeys.DFS_JOURNALNODE_DIR_KEY);
      assertEquals(
          new File(MiniDFSCluster.getBaseDirectory(conf) , "journalnode-0")
            .getAbsolutePath(),
          dir);
    } finally {
View Full Code Here

        editsDir.getAbsolutePath());
    conf.set(JournalConfigKeys.DFS_JOURNALNODE_RPC_ADDRESS_KEY, "0.0.0.0:0");
    int port = MiniJournalCluster.getFreeHttpPortAndUpdateConf(conf, true);
    httpAddress = "http://localhost:" + port;

    jn = new JournalNode();
    jn.setConf(conf);
    jn.start();
    journalId = "test-journalid-" + QJMTestUtil.uniqueSequenceId();
    journal = jn.getOrCreateJournal(QuorumJournalManager
        .journalIdStringToBytes(journalId));
View Full Code Here

          + op.getTransactionId());
    }
   
    // get the stream we are tailing from
    URLLogInputStream[] tailing = new URLLogInputStream[1];
    JournalNode jn = getTailingJN(is, tailing);
   
    long position = is.getPosition();
   
    // stop the node
    jn.stopAndJoin(0);
   
    // refresh the input stream
    is.refresh(position, 0);
   
    LOG.info("Checking failed stream");
View Full Code Here

    curIdxF.setAccessible(true);
    int curIdx = curIdxF.getInt(is);

    URLLogInputStream[] streams = getStreams(is);

    JournalNode jn = null;
    for (JournalNode j : cluster.getJournalNodes()) {
      if (streams[curIdx].getName().contains(
          Integer.toString(j.getBoundHttpAddress().getPort()))) {
        jn = j;
        break;
View Full Code Here

   */
  private void assertManifest(int iteration, MD5Hash digest,
      boolean skipPartial) throws IOException {
    if (!skipPartial) {
      for (int i = 0; i < cluster.getNumNodes(); i++) {
        JournalNode jn = cluster.getJournalNodes()[i];

        RemoteImageManifest rim = jn.getJournal(JID.getBytes())
            .getImageManifest(-1);
        assertEquals(iteration + 1, rim.getImages().size());
        for (int j = 0; j <= iteration; j++) {
          assertEquals(startTxId + j, rim.getImages().get(j).getTxId());
        }
View Full Code Here

    private void simulateFailute(InjectionEventI event, Object... args)
        throws IOException {
      // get the journal node
      ServletContext context = (ServletContext) args[0];
      JournalNode jn = (JournalNode) context
          .getAttribute(JournalNodeHttpServer.JN_ATTRIBUTE_KEY);
      // configuration stores the index of the node
      Configuration conf = jn.getConf();
      // check which node this is
      int jid = conf.getInt(MiniJournalCluster.DFS_JOURNALNODE_TEST_ID, 0);
      // fail if we are supposed to fail on this event
      if (event == failOn[jid]) {
        exceptionsThrown.incrementAndGet();
View Full Code Here

TOP

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

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.