code: public void waitForJTStart(JobConf jobConf) throws IOException {
      int maxJTAttempts = jobConf.getInt(
          "mapred.coronajobtracker.remotejobtracker.attempts", 4);
      ResourceTracker resourceTracker = jt.getResourceTracker();
      SessionDriver sessionDriver = jt.getSessionDriver();
      List<ResourceGrant> excludeGrants = new ArrayList<ResourceGrant>();
      boolean toExcludeFailed = jobConf.getBoolean(REMOTE_JT_EXCLUDE_FAILED, true);
      // Release and blacklist failed JT grant.
      if (remoteJTGrant != null) {
        if (toExcludeFailed) {
          excludeGrants.add(remoteJTGrant);
        }
        resourceTracker.releaseResource(remoteJTGrant.getId());
        sessionDriver.releaseResources(resourceTracker.getResourcesToRelease());
      }
      for (int i = 0; i < maxJTAttempts; i++) {
        try {
          remoteJTGrant = waitForJTGrant(resourceTracker, sessionDriver,
              excludeGrants);
          boolean success = startRemoteJT(jobConf, remoteJTGrant);
          if (success) {
            return;
          } else {
            excludeGrants.add(remoteJTGrant);
            resourceTracker.releaseResource(remoteJTGrant.getId());
            List<ResourceRequest> released =
              resourceTracker.getResourcesToRelease();
            sessionDriver.releaseResources(released);
          }
        } catch (InterruptedException e) {
          throw new IOException(e);
        }
      }
      throw new IOException("Could not start remote JT after " + maxJTAttempts +
        " attempts");
    }
docs: Waits for the remote Corona JT to be ready.
  This involves
  - getting a JOBTRACKER resource from the cluster manager.
  - starting the remote job tracker by connecting to the corona task
  tracker on the machine.
  - waiting for the remote job tracker to report its port back to this
  process.
  @param jobConf The job configuration to use.
  @throws IOException