Package org.apache.hadoop.hdfs.server.namenode

Examples of org.apache.hadoop.hdfs.server.namenode.ZookeeperTxId


      if (System.currentTimeMillis() - start > maxWaitTime) {
        throw new IOException("No valid last txid znode found");
      }
      try {
        long sessionId = zk.getPrimarySsId(address);
        ZookeeperTxId zkTxId = zk.getPrimaryLastTxId(address);
        if (sessionId != zkTxId.getSessionId()) {
          LOG.warn("Session Id in the ssid node : " + sessionId
              + " does not match the session Id in the txid node : "
              + zkTxId.getSessionId() + " retrying...");
          Thread.sleep(10000);
          continue;
        }
      } catch (Throwable e) {
        LOG.warn("Caught exception : " + e + " retrying ...");
View Full Code Here


        .getStartupConf());
    return zkClient.getPrimarySsId(address);
  }

  private void verifyState(long expectedTxid) throws Exception {
    ZookeeperTxId lastTxId = getLastTxid();
    assertNotNull(lastTxId);
    long sessionId = getSessionId();
    assertEquals(sessionId, lastTxId.getSessionId());
    assertEquals(expectedTxid - 1, lastTxId.getTransactionId());
  }
View Full Code Here

    createEdits(20);
    fs.close();
    InjectionHandler.set(new TestAvatarSyncLastTxidInjectionHandler());
    cluster.getPrimaryAvatar(0).avatar.shutdownAvatar();
    InjectionHandler.clear();
    ZookeeperTxId lastTxId = null;
    try {
      lastTxId = getLastTxid();
    } catch (NoNodeException e) {
      LOG.info("Expected exception", e);
      assertNull(lastTxId);
View Full Code Here

    createEdits(20);
    fs.close();
    InjectionHandler.set(new TestAvatarSyncLastTxidInjectionHandler());
    cluster.getPrimaryAvatar(0).avatar.shutdownAvatar();
    InjectionHandler.clear();
    ZookeeperTxId lastTxId = null;
    try {
      lastTxId = getLastTxid();
    } catch (NoNodeException e) {
      LOG.info("Expected exception", e);
      assertNull(lastTxId);
View Full Code Here

    createEdits(20);
    fs.close();
    InjectionHandler.set(new FailoverTestUtilHandler());
    cluster.getPrimaryAvatar(0).avatar.shutdownAvatar();
    InjectionHandler.clear();
    ZookeeperTxId lastTxId = null;
    try {
      lastTxId = getLastTxid();
    } catch (NoNodeException e) {
      LOG.info("Expected exception", e);
      assertNull(lastTxId);
View Full Code Here

    createEdits(20);
    fs.close();
    InjectionHandler.set(new FailoverTestUtilHandler());
    cluster.getPrimaryAvatar(0).avatar.shutdownAvatar();
    InjectionHandler.clear();
    ZookeeperTxId lastTxId = null;
    try {
      lastTxId = getLastTxid();
    } catch (NoNodeException e) {
      LOG.info("Expected exception", e);
      assertNull(lastTxId);
View Full Code Here

        .getStartupConf().get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY);
    return zkClient.getPrimarySsId(address, false);
  }

  protected void verifyState(long expectedTxid) throws Exception {
    ZookeeperTxId lastTxId = getLastTxid();
    assertNotNull(lastTxId);
    long sessionId = getSessionId();
    assertEquals(sessionId, lastTxId.getSessionId());
    assertEquals(expectedTxid - 1, lastTxId.getTransactionId());
  }
View Full Code Here

      if (System.currentTimeMillis() - start > maxWaitTime) {
        throw new IOException("No valid last txid znode found");
      }
      try {
        long sessionId = zk.getPrimarySsId(address, false);
        ZookeeperTxId zkTxId = zk.getPrimaryLastTxId(address, false);
        if (sessionId != zkTxId.getSessionId()) {
          LOG.warn("Session Id in the ssid node : " + sessionId
              + " does not match the session Id in the txid node : "
              + zkTxId.getSessionId() + " retrying...");
          Thread.sleep(retrySleep);
          continue;
        }
      } catch (Throwable e) {
        LOG.warn("Caught exception : " + e + " retrying ...");
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.ZookeeperTxId

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.