void start() throws Exception {
    if (amRegistry != null) {
      amRegistry.start();
      amRegistry.initializeWithoutRegistering();
      // Note: we may later have special logic to pick up old AMs, if any.
      amRegistry.registerStateChangeListener(new ChangeListener());
      amRegistry.populateCache(true);
    }

    this.parentSessionState = SessionState.get();
    if (initialSize == 0) return; // May be resized later.

    // Create and wait (get) for sessions to build
    createSessions(initialSize).get();
  }
The number of sessions that needs to be started or killed because of the resize calls on
the pool. When increasing the size, we set this to a positive number and start new sessions
on background threads, gradually bringing it back to 0.
When decreasing the size, we try to kill as many existing sessions as we can; if that is
not enough because the sessions are in use or being restarted, we kill them as they are
re-added to the pool.
Repeated calls to resize adjust the delta to ensure correctness between different resizes.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPool.java