Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.TempletonJobTracker


    }

    public List<String> run(String user)
        throws NotAuthorizedException, BadParam, IOException {
        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
        TempletonJobTracker tracker = null;
        try {
            tracker = new TempletonJobTracker(ugi,
                JobTracker.getAddress(appConf),
                appConf);

            ArrayList<String> ids = new ArrayList<String>();

            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();
                        }
                    }
                }
            }

            return ids;
        } catch (IllegalStateException e) {
            throw new BadParam(e.getMessage());
        } finally {
            if (tracker != null)
                tracker.close();
        }
    }
View Full Code Here


    }

    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

    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

    public List<String> run(String user)
        throws NotAuthorizedException, BadParam, IOException, InterruptedException {
       
        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
        TempletonJobTracker tracker = null;
        try {
            tracker = new TempletonJobTracker(getAddress(appConf),
                    appConf);

            ArrayList<String> ids = new ArrayList<String>();

            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();
                        }
                    }
                }
            }

            return ids;
        } catch (IllegalStateException e) {
            throw new BadParam(e.getMessage());
        } finally {
            if (tracker != null)
                tracker.close();
        }
    }
View Full Code Here

    }

    public QueueStatusBean run(String user, String id)
        throws NotAuthorizedException, BadParam, IOException, InterruptedException
    {
        TempletonJobTracker tracker = null;
        JobState state = null;
        try {
            tracker = new TempletonJobTracker(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

    public QueueStatusBean run(String user, String id)
        throws NotAuthorizedException, BadParam, IOException, InterruptedException
    {
        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
        TempletonJobTracker tracker = null;
        JobState state = null;
        try {
            tracker = new TempletonJobTracker(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

TOP

Related Classes of org.apache.hadoop.mapred.TempletonJobTracker

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.