public void update(int queryParallelism, double fraction,
        WmThreadSyncWork syncWork, EventState e, String schedulingPolicy) {
      this.finalFraction = this.finalFractionRemaining = fraction;
      this.queryParallelism = queryParallelism;
      if (metrics != null) {
        metrics.setParallelQueries(queryParallelism);
      }
      try {
        this.schedulingPolicy = MetaStoreUtils.parseSchedulingPolicy(schedulingPolicy);
      } catch (IllegalArgumentException ex) {
        // This should be validated at change time; let's fall back to a default here.
        LOG.error("Unknown scheduling policy " + schedulingPolicy + "; using FAIR");
        this.schedulingPolicy = WMPoolSchedulingPolicy.FAIR;
      }
      // TODO: two possible improvements
      //       1) Right now we kill all the queries here; we could just kill -qpDelta.
      //       2) After the queries are killed queued queries would take their place.
      //          If we could somehow restart queries we could instead put them at the front
      //          of the queue (esp. in conjunction with (1)) and rerun them.
      if (queryParallelism < getTotalActiveSessions()) {
        extractAllSessionsToKill("The query pool was resized by administrator",
            e.toReuse, syncWork);
      }
      // We will requeue, and not kill, the queries that are not running yet.
      // Insert them all before the get requests from this iteration.
      GetRequest req;
      if (metrics != null) {
        metrics.removeQueuedQueries(queue.size());
      }

      while ((req = queue.pollLast()) != null) {
        e.getRequests.addFirst(req);
      }
    }
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