Package org.apache.hadoop.hbase.master.RegionState

Examples of org.apache.hadoop.hbase.master.RegionState.State


   * @return True if specified region is in one of the specified states.
   */
  public synchronized boolean isRegionInState(
      final String regionName, final State... states) {
    RegionState regionState = getRegionState(regionName);
    State s = regionState != null ? regionState.getState() : null;
    for (State state: states) {
      if (s == state) return true;
    }
    return false;
  }
View Full Code Here


   * and offline, its state will be SPLIT. Otherwise, its state will
   * be OFFLINE. If it is already in RegionStates, this call has
   * no effect, and the original state is returned.
   */
  public synchronized RegionState createRegionState(final HRegionInfo hri) {
    State newState = (hri.isOffline() && hri.isSplit()) ? State.SPLIT : State.OFFLINE;
    String regionName = hri.getEncodedName();
    RegionState regionState = regionStates.get(regionName);
    if (regionState != null) {
      LOG.warn("Tried to create a state for a region already in RegionStates, "
        + "used existing: " + regionState + ", ignored new: " + newState);
View Full Code Here

        LOG.debug("Offline " + hri.getShortNameToLog()
          + " with current state=OFFLINE, assigned to server: "
          + sn + ", expected null");
      }
    }
    State newState = expectedState;
    if (newState == null) newState = State.OFFLINE;
    updateRegionState(hri, newState);
    regionsInTransition.remove(regionName);

    ServerName oldServerName = regionAssignments.remove(hri);
View Full Code Here

   * @return True if specified region is in one of the specified states.
   */
  public synchronized boolean isRegionInState(
      final String encodedName, final State... states) {
    RegionState regionState = getRegionState(encodedName);
    State s = regionState != null ? regionState.getState() : null;
    for (State state: states) {
      if (s == state) return true;
    }
    return false;
  }
View Full Code Here

   * and offline, its state will be SPLIT. Otherwise, its state will
   * be OFFLINE. If it is already in RegionStates, this call has
   * no effect, and the original state is returned.
   */
  public synchronized RegionState createRegionState(final HRegionInfo hri) {
    State newState = (hri.isOffline() && hri.isSplit()) ? State.SPLIT : State.OFFLINE;
    String encodedName = hri.getEncodedName();
    RegionState regionState = regionStates.get(encodedName);
    if (regionState != null) {
      LOG.warn("Tried to create a state for a region already in RegionStates, "
        + "used existing: " + regionState + ", ignored new: " + newState);
View Full Code Here

      final HRegionInfo hri, final State expectedState) {
    Preconditions.checkArgument(expectedState == null
      || RegionState.isUnassignable(expectedState),
        "Offlined region should not be " + expectedState);
    String encodedName = hri.getEncodedName();
    State newState =
      expectedState == null ? State.OFFLINE : expectedState;
    updateRegionState(hri, newState);
    regionsInTransition.remove(encodedName);

    ServerName oldServerName = regionAssignments.remove(hri);
View Full Code Here

   * @return True if specified region is in one of the specified states.
   */
  public synchronized boolean isRegionInState(
      final String encodedName, final State... states) {
    RegionState regionState = getRegionState(encodedName);
    State s = regionState != null ? regionState.getState() : null;
    for (State state: states) {
      if (s == state) return true;
    }
    return false;
  }
View Full Code Here

   * and offline, its state will be SPLIT. Otherwise, its state will
   * be OFFLINE. If it is already in RegionStates, this call has
   * no effect, and the original state is returned.
   */
  public synchronized RegionState createRegionState(final HRegionInfo hri) {
    State newState = (hri.isOffline() && hri.isSplit()) ? State.SPLIT : State.OFFLINE;
    String encodedName = hri.getEncodedName();
    RegionState regionState = regionStates.get(encodedName);
    if (regionState != null) {
      LOG.warn("Tried to create a state for a region already in RegionStates, "
        + "used existing: " + regionState + ", ignored new: " + newState);
View Full Code Here

      final HRegionInfo hri, final State expectedState) {
    Preconditions.checkArgument(expectedState == null
      || RegionState.isUnassignable(expectedState),
        "Offlined region should not be " + expectedState);
    String encodedName = hri.getEncodedName();
    State newState =
      expectedState == null ? State.OFFLINE : expectedState;
    updateRegionState(hri, newState);
    regionsInTransition.remove(encodedName);

    ServerName oldServerName = regionAssignments.remove(hri);
View Full Code Here

   * @return True if specified region is in specified state
   */
  public synchronized boolean isRegionInState(
      final HRegionInfo hri, final State state) {
    RegionState regionState = getRegionState(hri);
    State s = regionState != null ? regionState.getState() : null;
    return s == state;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.master.RegionState.State

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.