Package org.apache.hadoop.thriftfs.jobtracker.api

Examples of org.apache.hadoop.thriftfs.jobtracker.api.ThriftJobInProgress


         * Converts a JobInProgress object to its corresponding Thrift representation.
         * @param job Input JobInProgress object
         * @param includeTasks Include task information iff true
         */
        public static ThriftJobInProgress toThrift(JobInProgress job, boolean includeTasks, JobTracker tracker) {
            ThriftJobInProgress ret = new ThriftJobInProgress();

            // Take the lock so we can do an atomic copy
            synchronized(job) {
                ret.setDesiredMaps(job.desiredMaps());
                ret.setDesiredReduces(job.desiredReduces());
                ret.setFinishedMaps(job.finishedMaps());
                ret.setFinishedReduces(job.finishedReduces());

                ret.setJobID(toThrift(job.getJobID()));
                ret.setPriority(toThrift(job.getPriority()));
                ret.setProfile(toThrift(job.getProfile()));

                // Status lock is taken here
                ret.setStatus(toThrift(job.getStatus()));

                ret.setStartTime(job.getStartTime());
                ret.setFinishTime(job.getFinishTime());
                ret.setLaunchTime(job.getLaunchTime());
            }

            // No need to hang on to job lock now
            // TODO(henry/bc): By releasing the lock above, getInitialViewTaskList
            // may see a different view of the job and its task list. This
            // could cause inconsistency between the values copied above and
            // the tasks themselves, but no deadlocks/CMEs.
            if (includeTasks) {
                ret.setTasks(getInitialViewTaskList(job, tracker));
            }
            return ret;
        }
View Full Code Here


         * Thrift representation.
         * @param jobProfile The profile of a job.
         * @param jobStatus The status of a job.
         */
        public static ThriftJobInProgress toThrift(JobProfile jobProfile, JobStatus jobStatus) {
            ThriftJobInProgress ret = new ThriftJobInProgress();

            ret.setJobID(toThrift(jobProfile.getJobID()));
            ret.setPriority(toThrift(jobStatus.getJobPriority()));
            ret.setProfile(toThrift(jobProfile));

            ret.setStatus(toThrift(jobStatus));

            ret.setStartTime(jobStatus.getStartTime());

            return ret;
        }
View Full Code Here

            });
        }

        /** Kill a job by jobid */
        public void killJob(final RequestContext ctx, final ThriftJobID jobID) throws IOException, JobNotFoundException {
            ThriftJobInProgress job = assumeUserContextAndExecute(ctx, new PrivilegedExceptionAction<ThriftJobInProgress>() {
              public ThriftJobInProgress run() throws JobNotFoundException {
                return getJob(ctx, jobID);
              }
            });
            if (job == null) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.thriftfs.jobtracker.api.ThriftJobInProgress

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.