Package org.apache.hadoop.hdfs.protocol.AvatarConstants

Examples of org.apache.hadoop.hdfs.protocol.AvatarConstants.Avatar


   * argv[startindex].
   */
  private int showAvatar()
      throws IOException {
    int exitCode = 0;
    Avatar avatar = avatarnode.reportAvatar();
    System.out.println("The current avatar of " + AvatarNode.getAddress(conf)
        + " is " + avatar);
    return exitCode;
  }
View Full Code Here


  /**
   * Sets the avatar to the specified value
   */
  public int setAvatar(String role, boolean forceSetAvatar)
      throws IOException {
    Avatar dest;
    if (Avatar.ACTIVE.toString().equalsIgnoreCase(role)) {
      dest = Avatar.ACTIVE;
    } else if (Avatar.STANDBY.toString().equalsIgnoreCase(role)) {
      throw new IOException("setAvatar Command only works to switch avatar" +
          " from Standby to Primary");
    } else {
      throw new IOException("Unknown avatar type " + role);
    }
    Avatar current = avatarnode.getAvatar();
    if (current == dest) {
      System.out.println("This instance is already in " + current + " avatar.");
    } else {
      avatarnode.setAvatar(dest, forceSetAvatar);
      updateZooKeeper();
View Full Code Here

  public void leaveSafeMode() throws IOException {
    avatarnode.setSafeMode(SafeModeAction.SAFEMODE_LEAVE);
  }

  public void clearZooKeeper() throws IOException {
    Avatar avatar = avatarnode.getAvatar();
    if (avatar != Avatar.ACTIVE) {
      throw new IOException("Cannot clear zookeeper because the node " +
          " provided is not Primary");
    }
    String connection = conf.get("fs.ha.zookeeper.quorum");
View Full Code Here

   *
   * If any part of the path does not exist it is created automatically
   *
   */
  public void updateZooKeeper() throws IOException {
    Avatar avatar = avatarnode.getAvatar();
    if (avatar != Avatar.ACTIVE) {
      throw new IOException("Cannot update ZooKeeper information to point to " +
          "the AvatarNode in Standby mode");
    }
    String connection = conf.get("fs.ha.zookeeper.quorum");
View Full Code Here

   */
  public void updateZooKeeper(boolean force, boolean overwrite)
      throws IOException {
    if (!force) {
      initAvatarRPC();
      Avatar avatar = avatarnode.getAvatar();
      if (avatar != Avatar.ACTIVE) {
        throw new IOException(
            "Cannot update ZooKeeper information to point to "
                + "the AvatarNode in Standby mode");
      }
View Full Code Here

   * argv[startindex].
   */
  private int showAvatar()
      throws IOException {
    int exitCode = 0;
    Avatar avatar = avatarnode.reportAvatar();
    System.out.println("The current avatar of " + AvatarNode.getAddress(conf)
        + " is " + avatar);
    return exitCode;
  }
View Full Code Here

  /**
   * Sets the avatar to the specified value
   */
  public int setAvatar(String role, boolean noverification, String serviceName, String instance)
      throws IOException {
    Avatar dest;
    if (Avatar.ACTIVE.toString().equalsIgnoreCase(role)) {
      dest = Avatar.ACTIVE;
    } else if (Avatar.STANDBY.toString().equalsIgnoreCase(role)) {
      throw new IOException("setAvatar Command only works to switch avatar" +
          " from Standby to Primary");
    } else {
      throw new IOException("Unknown avatar type " + role);
    }
    Avatar current = avatarnode.getAvatar();
    if (current == dest) {
      System.out.println("This instance is already in " + current + " avatar.");
    } else {
      try {
        avatarnode.quiesceForFailover(noverification);
View Full Code Here

    System.out.println("Safe mode is " + (inSafeMode ? "ON" : "OFF"));
  }

  public void clearZooKeeper(String serviceName) throws IOException {
    Avatar avatar = avatarnode.getAvatar();
    if (avatar != Avatar.ACTIVE) {
      throw new IOException("Cannot clear zookeeper because the node " +
          " provided is not Primary");
    }
    AvatarNodeZkUtil.clearZookeeper(originalConf, conf, serviceName);
View Full Code Here

   *
   * If any part of the path does not exist it is created automatically
   *
   */
  public void updateZooKeeper(String serviceName, String instance) throws IOException {
    Avatar avatar = avatarnode.getAvatar();
    if (avatar != Avatar.ACTIVE) {
      throw new IOException("Cannot update ZooKeeper information to point to " +
          "the AvatarNode in Standby mode");
    }
    AvatarNodeZkUtil.updateZooKeeper(originalConf, conf, true, serviceName, instance);
View Full Code Here

   */
  public void updateZooKeeper(boolean force, boolean toOverwrite, String serviceName, String primary)
      throws IOException {
    if (!force) {
      initAvatarRPC();
      Avatar avatar = avatarnode.getAvatar();
      if (avatar != Avatar.ACTIVE) {
        throw new IOException(
            "Cannot update ZooKeeper information to point to "
                + "the AvatarNode in Standby mode");
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.protocol.AvatarConstants.Avatar

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.