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

Examples of org.apache.hadoop.hdfs.server.namenode.ha.HAState


      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    return new NNHAStatusHeartbeat(state.getServiceState(),
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here


      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    NNHAStatusHeartbeat.State hbState;
    if (state instanceof ActiveState) {
      hbState = NNHAStatusHeartbeat.State.ACTIVE;
    } else if (state instanceof StandbyState) {
      hbState = NNHAStatusHeartbeat.State.STANDBY;     
    } else {
      throw new AssertionError("Invalid state: " + state.getClass());
    }
    return new NNHAStatusHeartbeat(hbState,
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

    FSNamesystem fsNamesystem = new FSNamesystem(conf, fsImage);
    FSNamesystem fsn = Mockito.spy(fsNamesystem);

    //Make shouldPopulaeReplQueues return true
    HAContext haContext = Mockito.mock(HAContext.class);
    HAState haState = Mockito.mock(HAState.class);
    Mockito.when(haContext.getState()).thenReturn(haState);
    Mockito.when(haState.shouldPopulateReplQueues()).thenReturn(true);
    Whitebox.setInternalState(fsn, "haContext", haContext);

    //Make NameNode.getNameNodeMetrics() not return null
    NameNode.initMetrics(conf, NamenodeRole.NAMENODE);
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    return new NNHAStatusHeartbeat(state.getServiceState(),
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    return new NNHAStatusHeartbeat(state.getServiceState(),
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

    FSNamesystem fsNamesystem = new FSNamesystem(conf, fsImage);
    FSNamesystem fsn = Mockito.spy(fsNamesystem);

    //Make shouldPopulaeReplQueues return true
    HAContext haContext = Mockito.mock(HAContext.class);
    HAState haState = Mockito.mock(HAState.class);
    Mockito.when(haContext.getState()).thenReturn(haState);
    Mockito.when(haState.shouldPopulateReplQueues()).thenReturn(true);
    Whitebox.setInternalState(fsn, "haContext", haContext);

    //Make NameNode.getNameNodeMetrics() not return null
    NameNode.initMetrics(conf, NamenodeRole.NAMENODE);
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    NNHAStatusHeartbeat.State hbState;
    if (state instanceof ActiveState) {
      hbState = NNHAStatusHeartbeat.State.ACTIVE;
    } else if (state instanceof StandbyState) {
      hbState = NNHAStatusHeartbeat.State.STANDBY;     
    } else {
      throw new AssertionError("Invalid state: " + state.getClass());
    }
    return new NNHAStatusHeartbeat(hbState,
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    return new NNHAStatusHeartbeat(state.getServiceState(),
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    return new NNHAStatusHeartbeat(state.getServiceState(),
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

      readUnlock();
    }
  }

  private NNHAStatusHeartbeat createHaStatusHeartbeat() {
    HAState state = haContext.getState();
    NNHAStatusHeartbeat.State hbState;
    if (state instanceof ActiveState) {
      hbState = NNHAStatusHeartbeat.State.ACTIVE;
    } else if (state instanceof StandbyState) {
      hbState = NNHAStatusHeartbeat.State.STANDBY;     
    } else {
      throw new AssertionError("Invalid state: " + state.getClass());
    }
    return new NNHAStatusHeartbeat(hbState,
        getFSImage().getLastAppliedOrWrittenTxId());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.ha.HAState

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.