public static Position getFavoredServerPosition(List<ServerName> favoredNodes,
    ServerName server) {
    if (
      favoredNodes == null || server == null
        || favoredNodes.size() != FavoredNodeAssignmentHelper.FAVORED_NODES_NUM
    ) {
      return null;
    }
    for (Position p : Position.values()) {
      if (ServerName.isSameAddress(favoredNodes.get(p.ordinal()), server)) {
        return p;
      }
    }
    return null;
  }
Return the position of the server in the favoredNodes list. Assumes the favoredNodes list is of
size 3.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java