Examples of JobState


Examples of org.apache.hadoop.mapreduce.v2.api.records.JobState

      writeLock.unlock();
    }
  }

  private void rememberLastNonFinalState(JobStateInternal stateInternal) {
    JobState state = getExternalState(stateInternal);
    // if state is not the final state, set lastNonFinalState
    if (state != JobState.SUCCEEDED && state != JobState.FAILED
        && state != JobState.KILLED && state != JobState.ERROR) {
      lastNonFinalState = state;
    }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.v2.api.records.JobState

    return jobIndexInfo.getQueueName();
  }

  @Override
  public JobState getState() {
    JobState js = null;
    try {
      js = JobState.valueOf(jobIndexInfo.getJobStatus());
    } catch (Exception e) {
      // Meant for use by the display UI. Exception would prevent it from being
      // rendered.e Defaulting to KILLED
View Full Code Here

Examples of org.apache.hadoop.mapreduce.v2.api.records.JobState

  public Counters getAllCounters() {

    readLock.lock();

    try {
      JobState state = getState();
      if (state == JobState.ERROR || state == JobState.FAILED
          || state == JobState.KILLED || state == JobState.SUCCEEDED) {
        this.mayBeConstructFinalFullCounters();
        return fullCounters;
      }
View Full Code Here

Examples of org.apache.hama.bsp.Job.JobState

        envs.get(ApplicationConstants.AM_CONTAINER_ID_ENV))
        .getApplicationAttemptId();
  }

  private void start() throws Exception {
    JobState finalState = null;
    try {
      job = new JobImpl(appAttemptId, jobConf, yarnRPC, amrmRPC, jobFile, jobId);
      finalState = job.startJob();
    } finally {
      if (finalState != null) {
        LOG.info("Job \"" + applicationName + "\"'s state after completion: "
            + finalState.toString());
        LOG.info("Job took " + ((clock.getTime() - startTime) / 1000L)
            + "s to finish!");
      }
      job.cleanup();
    }
View Full Code Here

Examples of org.apache.hcatalog.templeton.tool.JobState

    public CompleteBean run(String id)
        throws CallbackFailedException, IOException {
        if (id == null)
            acceptWithError("No jobid given");

        JobState state = null;
        try {
            state = new JobState(id, Main.getAppConfigInstance());
            if (state.getCompleteStatus() == null)
                failed("Job not yet complete", null);

            Long notified = state.getNotifiedTime();
            if (notified != null)
                return acceptWithError("Callback already run on "
                    + new Date(notified.longValue()));

            String callback = state.getCallback();
            if (callback == null)
                return new CompleteBean("No callback registered");

            try {
                doCallback(state.getId(), callback);
            } catch (Exception e) {
                failed("Callback failed " + callback + " for " + id, e);
            }

            state.setNotifiedTime(System.currentTimeMillis());
            return new CompleteBean("Callback sent");
        } finally {
            if (state != null)
                state.close();
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.templeton.tool.JobState

        super(appConf);
    }

    public void registerJob(String id, String user, String callback)
        throws IOException {
        JobState state = null;
        try {
            state = new JobState(id, Main.getAppConfigInstance());
            state.setUser(user);
            state.setCallback(callback);
        } finally {
            if (state != null)
                state.close();
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.templeton.tool.JobState

            JobStatus[] jobs = tracker.getAllJobs();

            if (jobs != null) {
                for (JobStatus job : jobs) {
                    JobState state = null;
                    try {
                        String id = job.getJobID().toString();
                        state = new JobState(id, Main.getAppConfigInstance());
                        if (user.equals(state.getUser()))
                            ids.add(id);
                    } finally {
                        if (state != null) {
                            state.close();
                        }
                    }
                }
            }
View Full Code Here

Examples of org.apache.hcatalog.templeton.tool.JobState

    public QueueStatusBean run(String user, String id)
        throws NotAuthorizedException, BadParam, IOException {
        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
        TempletonJobTracker tracker = null;
        JobState state = null;
        try {
            tracker = new TempletonJobTracker(ugi,
                JobTracker.getAddress(appConf),
                appConf);
            JobID jobid = StatusDelegator.StringToJobID(id);
            if (jobid == null)
                throw new BadParam("Invalid jobid: " + id);
            state = new JobState(id, Main.getAppConfigInstance());
            return StatusDelegator.makeStatus(tracker, jobid, state);
        } catch (IllegalStateException e) {
            throw new BadParam(e.getMessage());
        } finally {
            if (tracker != null)
                tracker.close();
            if (state != null)
                state.close();
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.templeton.tool.JobState

    public QueueStatusBean run(String user, String id)
        throws NotAuthorizedException, BadParam, IOException
    {
        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
        TempletonJobTracker tracker = null;
        JobState state = null;
        try {
            tracker = new TempletonJobTracker(ugi,
                                              JobTracker.getAddress(appConf),
                                              appConf);
            JobID jobid = StatusDelegator.StringToJobID(id);
            if (jobid == null)
                throw new BadParam("Invalid jobid: " + id);
            tracker.killJob(jobid);
            state = new JobState(id, Main.getAppConfigInstance());
            String childid = state.getChildId();
            if (childid != null)
                tracker.killJob(StatusDelegator.StringToJobID(childid));
            return StatusDelegator.makeStatus(tracker, jobid, state);
        } catch (IllegalStateException e) {
            throw new BadParam(e.getMessage());
        } finally {
            if (tracker != null)
                tracker.close();
            if (state != null)
                state.close();
        }
    }
View Full Code Here

Examples of org.apache.hive.hcatalog.templeton.tool.JobState

  public CompleteBean run(String id)
    throws CallbackFailedException, IOException {
    if (id == null)
      acceptWithError("No jobid given");

    JobState state = null;
    try {
      state = new JobState(id, Main.getAppConfigInstance());
      if (state.getCompleteStatus() == null)
        failed("Job not yet complete. jobId=" + id, null);

      Long notified = state.getNotifiedTime();
      if (notified != null)
        return acceptWithError("Callback already run for jobId=" + id +
                " at " + new Date(notified));

      String callback = state.getCallback();
      if (callback == null)
        return new CompleteBean("No callback registered");

      try {
        doCallback(state.getId(), callback);
      } catch (Exception e) {
        failed("Callback failed " + callback + " for " + id, e);
      }

      state.setNotifiedTime(System.currentTimeMillis());
      return new CompleteBean("Callback sent");
    } finally {
      if (state != null)
        state.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.