org.apache.hadoop.mapreduce.tools

## Class CLI

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.hadoop.mapreduce.tools.CLI

- All Implemented Interfaces:
    org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool
  Direct Known Subclasses:
    JobClient

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class CLI
      extends org.apache.hadoop.conf.Configured
      implements org.apache.hadoop.util.Tool

  Interprets the map reduce cli options

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Cluster` | `cluster`
    `static String` | `dataPattern`
    `static String` | `headerPattern`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CLI()`
    `CLI(org.apache.hadoop.conf.Configuration conf)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `displayJobList(JobStatus[] jobs)`
    `void` | `displayJobList(JobStatus[] jobs, PrintWriter writer)`
    `protected void` | `displayTasks(Job job, String type, String state)` Display the information about a job's tasks, of a particular type and in a particular state
    `protected long` | `getCounter(Counters counters, String counterGroupName, String counterName)`
    `protected static String` | `getTaskLogURL(TaskAttemptID taskId, String baseUrl)`
    `static void` | `main(String[] argv)`
    `int` | `run(String[] argv)`

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.hadoop.conf.Configurable

      `getConf, setConf`

- - ### Field Detail

    - #### cluster

          protected Cluster cluster

    - #### headerPattern

          @InterfaceAudience.Private
          public static String headerPattern

    - #### dataPattern

          @InterfaceAudience.Private
          public static String dataPattern

  - ### Constructor Detail

    - #### CLI

          public CLI()

    - #### CLI

          public CLI(org.apache.hadoop.conf.Configuration conf)

  - ### Method Detail

    - #### run

          public int run(String[] argv)
                  throws Exception

      Specified by:
        `run` in interface `org.apache.hadoop.util.Tool`
      Throws:
        `Exception`

    - #### getCounter

          protected long getCounter(Counters counters,
                                    String counterGroupName,
                                    String counterName)
                             throws IOException

      Throws:
        `IOException`

    - #### getTaskLogURL

          protected static String getTaskLogURL(TaskAttemptID taskId,
                                                String baseUrl)

    - #### displayTasks

          protected void displayTasks(Job job,
                                      String type,
                                      String state)
                               throws IOException,
                                      InterruptedException

      Display the information about a job's tasks, of a particular type and in a particular state
      Parameters:
        `job` - the job
        `type` - the type of the task (map/reduce/setup/cleanup)
        `state` - the state of the task (pending/running/completed/failed/killed)
      Throws:
        `IOException` - when there is an error communicating with the master
        `InterruptedException`
        `IllegalArgumentException` - if an invalid type/state is passed

    - #### displayJobList

          public void displayJobList(JobStatus[] jobs)
                              throws IOException,
                                     InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### displayJobList

          @InterfaceAudience.Private
          public void displayJobList(JobStatus[] jobs,
                                                                PrintWriter writer)

    - #### main

          public static void main(String[] argv)
                           throws Exception

      Throws:
        `Exception`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.