Example usage for org.apache.hadoop.mapred JobQueueInfo getSchedulingInfo

List of usage examples for org.apache.hadoop.mapred JobQueueInfo getSchedulingInfo

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobQueueInfo getSchedulingInfo.

Prototype

public String getSchedulingInfo() 

Source Link

Document

Gets the scheduling information associated to particular job queue.

Usage

From source file:org.apache.ambari.servicemonitor.clients.JTListQueue.java

License:Apache License

@Override
protected Operation executeOneOperation() throws IOException {
    Operation operation = new Operation("lsqueue " + queuename);

    started(operation);/*from ww w  .java 2 s .  com*/
    JobClient jobClient = null;
    try {

        jobClient = new JobClient(jtAddr, getConf());
        JobQueueInfo queueInfo = jobClient.getQueueInfo(queuename);
        operation.setText("Queue " + queuename + " is in state " + queueInfo.getQueueState()
                + "; scheduling info: " + queueInfo.getSchedulingInfo());
        operation.success();
    } catch (ExitClientRunException e) {
        //propagate this up
        throw e;
    } catch (IOException e) {
        //all other outcomes are failures
        operation.failure(e);
    } finally {
        MonitorUtils.closeJobClient(jobClient);
    }
    return operation;
}

From source file:org.openflamingo.engine.monitoring.hadoop.JobTrackerMonitor.java

License:Apache License

public void printJobs() throws IOException {
    JobConf conf = new JobConf();
    conf.set("mapred.job,tracker", "localhost:9001");

    JobClient jobClient = new JobClient(conf);
    JobStatus[] allJobs = jobClient.getAllJobs();
    if (allJobs != null) {
        for (JobStatus status : allJobs) {
            System.out.println(status.getJobID());
            System.out.println(status.getSchedulingInfo());
        }/*from  w w  w .  j  av a2  s  .co  m*/
    }

    System.out.println(jobClient.getClusterStatus().getMapTasks());

    JobQueueInfo[] queues = jobClient.getQueues();
    if (queues != null)
        for (JobQueueInfo queue : queues) {
            System.out.println(queue.getQueueName());
            System.out.println(queue.getSchedulingInfo());
            System.out.println(queue.getQueueState());
        }

    JobStatus[] jobStatuses = jobClient.jobsToComplete();
    if (jobStatuses != null)
        for (JobStatus jobStatus : jobStatuses) {
            System.out.println(jobStatus.getJobID().getId());
            System.out.println(jobStatus.getSchedulingInfo());
        }
}