public double updateAllocationPercentages() {
      switch (schedulingPolicy) {
      case FAIR:
        int totalSessions = sessions.size() + initializingSessions.size();
        if (totalSessions == 0) return 0;
        double allocation = finalFractionRemaining / totalSessions;
        for (WmTezSession session : sessions) {
          updateSessionAllocationWithEvent(session, allocation);
        }
        // Do not give out the capacity of the initializing sessions to the running ones;
        // we expect init to be fast.
        return finalFractionRemaining - allocation * initializingSessions.size();
      case FIFO:
        if (sessions.isEmpty()) return 0;
        boolean isFirst = true;
        for (WmTezSession session : sessions) {
          updateSessionAllocationWithEvent(session, isFirst ? finalFractionRemaining : 0);
          isFirst = false;
        }
        return finalFractionRemaining;
      default:
        throw new AssertionError("Unexpected enum value " + schedulingPolicy);
      }
    }
State of a single pool.
Unless otherwise specified, the members are only modified by the master thread.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java