Package org.apache.hadoop.corona

Examples of org.apache.hadoop.corona.SessionDriver$CMNotifierThread


   */
  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>();
    for (int i = 0; i < maxJTAttempts; i++) {
      try {
        ResourceGrant jtGrant = waitForJTGrant(resourceTracker, sessionDriver,
            excludeGrants);
        boolean success = startRemoteJT(jobConf, jtGrant);
        if (success) {
          return;
        } else {
          excludeGrants.add(jtGrant);
          resourceTracker.releaseResource(jtGrant.getId());
          List<ResourceRequest> released =
            resourceTracker.getResourcesToRelease();
          sessionDriver.releaseResources(released);
        }
      } catch (InterruptedException e) {
        throw new IOException(e);
      }

View Full Code Here


    return sessionId;
  }

  private void createSession() throws IOException {
    // Create the session driver. This will contact the cluster manager.
    sessionDriver = new SessionDriver(conf, this);
    sessionId = sessionDriver.getSessionId();
  }
View Full Code Here

   */
  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);
      }
    }
View Full Code Here

    /**
     * Restarts remote JT if there was running job and resubmits this job.
     * @throws IOException
     */
    private void restartRemoteJTUnprotected() throws IOException {
      SessionDriver sessionDriver = jt.getSessionDriver();
      if (remoteSessionId != null) {
        // Kill remote session - new JT will acquire new session
        sessionDriver.stopRemoteSession(remoteSessionId);
      }
      if (!isStateRestoringEnabled(conf)) {
        // Change attempt id only if we're not restoring state
        attemptJobId = prepareNextAttempt(attemptJobId);
      } else {
        // notify the remote job tracker the number of
        // remote job tracker get restarted
        remoteJTState.restartNum = numRemoteJTFailures;
      }
      // Stop RPC client.
      RPC.stopProxy(client);
      client = null;
      // Increment attempt to kill old JT on next connection attempt.
      incrementAttemptUnprotected();
      if (sessionDriver != null) {
        sessionDriver.setName("Launch pending for " + conf.getJobName());
      }
      // Restart remote JT, don't release client lock yet.
      waitForJTStart(conf);
      // Resubmit job directly.
      try {
        if (isJobSubmitted) {
          LOG.warn("Resubmitting job " + jobId.toString());
          client.submitJob(attemptJobId);
        }
        // Set our info server url in parent JT and CM.
        String url = getJobProfile(attemptJobId).getURL().toString();
        jt.setRemoteJTUrl(url);
        if (sessionDriver != null) {
          sessionDriver.setName("Launched session " + getRemoteSessionId());
        }
        // If reached this point assume success.
        LOG.warn("Successfully restarted remote JT.");
        if (remoteJTState != null) {
          if (LOG.isInfoEnabled()) {
View Full Code Here

    return sessionId;
  }

  private void createSession() throws IOException {
    // Create the session driver. This will contact the cluster manager.
    sessionDriver = new SessionDriver(conf, this);
    sessionId = sessionDriver.getSessionId();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.corona.SessionDriver$CMNotifierThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.