Examples of Avatar


Examples of model.Avatar

        }
    }

    public short buyOrganism(int organism_type, int player_id, int species_id, int amount, int zone_id, float xCoor, float yCoor) {
        Player player = GameServer.getInstance().getActivePlayer(player_id);
        Avatar avatar = player.getAvatar();

        if (avatar != null) {
            SpeciesType species = null;

            if (organism_type == Constants.ORGANISM_TYPE_PLANT) {
                species = GameServer.getInstance().getPlantType(species_id);
            } else if (organism_type == Constants.ORGANISM_TYPE_ANIMAL) {
                species = GameServer.getInstance().getAnimalType(species_id);
            }

            boolean canBuy = avatar.spendCash(species.getCost());

            if (canBuy) {
                GameServer.getInstance().updateCash(player, 0);

                Zone zone = zones.get(zone_id);
View Full Code Here

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

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

  /**
   * 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

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

  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

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

   *
   * 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

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

   */
  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

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

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

  /**
   * 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

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

    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

Examples of org.beangle.ems.avatar.Avatar

    }
    return contains;
  }

  public Avatar getAvatar(String name) {
    Avatar avatar = null;
    for (AvatarBase base : bases) {
      avatar = base.getAvatar(name);
      if (null != avatar) {
        break;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.