org.apache.hadoop.mapreduce.protocol

## Interface ClientProtocol

- All Superinterfaces:
    org.apache.hadoop.ipc.VersionedProtocol

      @InterfaceAudience.Private
       @InterfaceStability.Stable
      public interface ClientProtocol
      extends org.apache.hadoop.ipc.VersionedProtocol

  Protocol that a JobClient and the central JobTracker use to communicate. The JobClient can use these methods to submit a Job for execution, and learn about the current system status.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `versionID`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancelDelegationToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)` Cancel a delegation token.
    `TaskTrackerInfo[]` | `getActiveTrackers()` Get all active trackers in cluster.
    `JobStatus[]` | `getAllJobs()` Get all the jobs submitted.
    `TaskTrackerInfo[]` | `getBlacklistedTrackers()` Get all blacklisted trackers in cluster.
    `QueueInfo[]` | `getChildQueues(String queueName)` Returns immediate children of queueName.
    `ClusterMetrics` | `getClusterMetrics()` Get the current status of the cluster
    `org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>` | `getDelegationToken(org.apache.hadoop.io.Text renewer)` Get a new delegation token.
    `String` | `getFilesystemName()` A MapReduce system always operates on a single filesystem.
    `Counters` | `getJobCounters(JobID jobid)` Grab the current job counters
    `String` | `getJobHistoryDir()` Gets the directory location of the completed job history files.
    `JobStatus` | `getJobStatus(JobID jobid)` Grab a handle to a job that is already known to the JobTracker.
    `Cluster.JobTrackerStatus` | `getJobTrackerStatus()` Get the JobTracker's status.
    `LogParams` | `getLogFileParams(JobID jobID, TaskAttemptID taskAttemptID)` Gets the location of the log file for a job if no taskAttemptId is specified, otherwise gets the log location for the taskAttemptId.
    `JobID` | `getNewJobID()` Allocate a name for the job.
    `QueueInfo` | `getQueue(String queueName)` Gets scheduling information associated with the particular Job queue
    `QueueAclsInfo[]` | `getQueueAclsForCurrentUser()` Gets the Queue ACLs for current user
    `org.apache.hadoop.security.authorize.AccessControlList` | `getQueueAdmins(String queueName)` Get the administrators of the given job-queue.
    `QueueInfo[]` | `getQueues()` Gets set of Queues associated with the Job Tracker
    `QueueInfo[]` | `getRootQueues()` Gets the root level queues.
    `String` | `getStagingAreaDir()` Get a hint from the JobTracker where job-specific files are to be placed.
    `String` | `getSystemDir()` Grab the jobtracker system directory path where job-specific files are to be placed.
    `TaskCompletionEvent[]` | `getTaskCompletionEvents(JobID jobid, int fromEventId, int maxEvents)` Get task completion events for the jobid, starting from fromEventId.
    `String[]` | `getTaskDiagnostics(TaskAttemptID taskId)` Get the diagnostics for a given task in a given job
    `TaskReport[]` | `getTaskReports(JobID jobid, TaskType type)` Grab a bunch of info on the tasks that make up the job
    `long` | `getTaskTrackerExpiryInterval()`
    `void` | `killJob(JobID jobid)` Kill the indicated job
    `boolean` | `killTask(TaskAttemptID taskId, boolean shouldFail)` Kill indicated task attempt.
    `long` | `renewDelegationToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)` Renew an existing delegation token
    `void` | `setJobPriority(JobID jobid, String priority)` Set the priority of the specified job
    `JobStatus` | `submitJob(JobID jobId, String jobSubmitDir, org.apache.hadoop.security.Credentials ts)` Submit a Job for execution.

    - ### Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol

      `getProtocolSignature, getProtocolVersion`

- - ### Field Detail

    - #### versionID

          static final long versionID

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getNewJobID

          JobID getNewJobID()
                     throws IOException,
                            InterruptedException

      Allocate a name for the job.
      Returns:
        a unique job name for submitting jobs.
      Throws:
        `IOException`
        `InterruptedException`

    - #### submitJob

          JobStatus submitJob(JobID jobId,
                              String jobSubmitDir,
                              org.apache.hadoop.security.Credentials ts)
                       throws IOException,
                              InterruptedException

      Submit a Job for execution. Returns the latest profile for that job.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getClusterMetrics

          ClusterMetrics getClusterMetrics()
                                    throws IOException,
                                           InterruptedException

      Get the current status of the cluster
      Returns:
        summary of the state of the cluster
      Throws:
        `IOException`
        `InterruptedException`

    - #### getJobTrackerStatus

          Cluster.JobTrackerStatus getJobTrackerStatus()
                                                throws IOException,
                                                       InterruptedException

      Get the JobTracker's status.
      Returns:
        `Cluster.JobTrackerStatus` of the JobTracker
      Throws:
        `IOException`
        `InterruptedException`

    - #### getTaskTrackerExpiryInterval

          long getTaskTrackerExpiryInterval()
                                     throws IOException,
                                            InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### getQueueAdmins

          org.apache.hadoop.security.authorize.AccessControlList getQueueAdmins(String queueName)
                                                                         throws IOException

      Get the administrators of the given job-queue. This method is for hadoop internal use only.
      Parameters:
        `queueName` -
      Returns:
        Queue administrators ACL for the queue to which job is submitted to
      Throws:
        `IOException`

    - #### killJob

          void killJob(JobID jobid)
                throws IOException,
                       InterruptedException

      Kill the indicated job
      Throws:
        `IOException`
        `InterruptedException`

    - #### setJobPriority

          void setJobPriority(JobID jobid,
                              String priority)
                       throws IOException,
                              InterruptedException

      Set the priority of the specified job
      Parameters:
        `jobid` - ID of the job
        `priority` - Priority to be set for the job
      Throws:
        `IOException`
        `InterruptedException`

    - #### killTask

          boolean killTask(TaskAttemptID taskId,
                           boolean shouldFail)
                    throws IOException,
                           InterruptedException

      Kill indicated task attempt.
      Parameters:
        `taskId` - the id of the task to kill.
        `shouldFail` - if true the task is failed and added to failed tasks list, otherwise it is just killed, w/o affecting job failure status.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getJobStatus

          JobStatus getJobStatus(JobID jobid)
                          throws IOException,
                                 InterruptedException

      Grab a handle to a job that is already known to the JobTracker.
      Returns:
        Status of the job, or null if not found.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getJobCounters

          Counters getJobCounters(JobID jobid)
                           throws IOException,
                                  InterruptedException

      Grab the current job counters
      Throws:
        `IOException`
        `InterruptedException`

    - #### getTaskReports

          TaskReport[] getTaskReports(JobID jobid,
                                      TaskType type)
                               throws IOException,
                                      InterruptedException

      Grab a bunch of info on the tasks that make up the job
      Throws:
        `IOException`
        `InterruptedException`

    - #### getFilesystemName

          String getFilesystemName()
                            throws IOException,
                                   InterruptedException

      A MapReduce system always operates on a single filesystem. This function returns the fs name. ('local' if the localfs; 'addr:port' if dfs). The client can then copy files into the right locations prior to submitting the job.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getAllJobs

          JobStatus[] getAllJobs()
                          throws IOException,
                                 InterruptedException

      Get all the jobs submitted.
      Returns:
        array of JobStatus for the submitted jobs
      Throws:
        `IOException`
        `InterruptedException`

    - #### getTaskCompletionEvents

          TaskCompletionEvent[] getTaskCompletionEvents(JobID jobid,
                                                        int fromEventId,
                                                        int maxEvents)
                                                 throws IOException,
                                                        InterruptedException

      Get task completion events for the jobid, starting from fromEventId. Returns empty array if no events are available.
      Parameters:
        `jobid` - job id
        `fromEventId` - event id to start from.
        `maxEvents` - the max number of events we want to look at
      Returns:
        array of task completion events.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getTaskDiagnostics

          String[] getTaskDiagnostics(TaskAttemptID taskId)
                               throws IOException,
                                      InterruptedException

      Get the diagnostics for a given task in a given job
      Parameters:
        `taskId` - the id of the task
      Returns:
        an array of the diagnostic messages
      Throws:
        `IOException`
        `InterruptedException`

    - #### getActiveTrackers

          TaskTrackerInfo[] getActiveTrackers()
                                       throws IOException,
                                              InterruptedException

      Get all active trackers in cluster.
      Returns:
        array of TaskTrackerInfo
      Throws:
        `IOException`
        `InterruptedException`

    - #### getBlacklistedTrackers

          TaskTrackerInfo[] getBlacklistedTrackers()
                                            throws IOException,
                                                   InterruptedException

      Get all blacklisted trackers in cluster.
      Returns:
        array of TaskTrackerInfo
      Throws:
        `IOException`
        `InterruptedException`

    - #### getSystemDir

          String getSystemDir()
                       throws IOException,
                              InterruptedException

      Grab the jobtracker system directory path where job-specific files are to be placed.
      Returns:
        the system directory where job-specific files are to be placed.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getStagingAreaDir

          String getStagingAreaDir()
                            throws IOException,
                                   InterruptedException

      Get a hint from the JobTracker where job-specific files are to be placed.
      Returns:
        the directory where job-specific files are to be placed.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getJobHistoryDir

          String getJobHistoryDir()
                           throws IOException,
                                  InterruptedException

      Gets the directory location of the completed job history files.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getQueues

          QueueInfo[] getQueues()
                         throws IOException,
                                InterruptedException

      Gets set of Queues associated with the Job Tracker
      Returns:
        Array of the Queue Information Object
      Throws:
        `IOException`
        `InterruptedException`

    - #### getQueue

          QueueInfo getQueue(String queueName)
                      throws IOException,
                             InterruptedException

      Gets scheduling information associated with the particular Job queue
      Parameters:
        `queueName` - Queue Name
      Returns:
        Scheduling Information of the Queue
      Throws:
        `IOException`
        `InterruptedException`

    - #### getQueueAclsForCurrentUser

          QueueAclsInfo[] getQueueAclsForCurrentUser()
                                              throws IOException,
                                                     InterruptedException

      Gets the Queue ACLs for current user
      Returns:
        array of QueueAclsInfo object for current user.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getRootQueues

          QueueInfo[] getRootQueues()
                             throws IOException,
                                    InterruptedException

      Gets the root level queues.
      Returns:
        array of JobQueueInfo object.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getChildQueues

          QueueInfo[] getChildQueues(String queueName)
                              throws IOException,
                                     InterruptedException

      Returns immediate children of queueName.
      Parameters:
        `queueName` -
      Returns:
        array of JobQueueInfo which are children of queueName
      Throws:
        `IOException`
        `InterruptedException`

    - #### getDelegationToken

          org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> getDelegationToken(org.apache.hadoop.io.Text renewer)
                                                                                        throws IOException,
                                                                                               InterruptedException

      Get a new delegation token.
      Parameters:
        `renewer` - the user other than the creator (if any) that can renew the token
      Returns:
        the new delegation token
      Throws:
        `IOException`
        `InterruptedException`

    - #### renewDelegationToken

          long renewDelegationToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)
                             throws IOException,
                                    InterruptedException

      Renew an existing delegation token
      Parameters:
        `token` - the token to renew
      Returns:
        the new expiration time
      Throws:
        `IOException`
        `InterruptedException`

    - #### cancelDelegationToken

          void cancelDelegationToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)
                              throws IOException,
                                     InterruptedException

      Cancel a delegation token.
      Parameters:
        `token` - the token to cancel
      Throws:
        `IOException`
        `InterruptedException`

    - #### getLogFileParams

          LogParams getLogFileParams(JobID jobID,
                                     TaskAttemptID taskAttemptID)
                              throws IOException,
                                     InterruptedException

      Gets the location of the log file for a job if no taskAttemptId is specified, otherwise gets the log location for the taskAttemptId.
      Parameters:
        `jobID` - the jobId.
        `taskAttemptID` - the taskAttemptId.
      Returns:
        log params.
      Throws:
        `IOException`
        `InterruptedException`

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