Package org.apache.hadoop.mapreduce
Class Cluster
java.lang.Object
org.apache.hadoop.mapreduce.Cluster
Provides a way to access information about the map/reduce cluster.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCluster(InetSocketAddress jobTrackAddr, Configuration conf) Cluster(Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelDelegationToken(Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> token) Deprecated.voidclose()Close theCluster.Get all active trackers in the cluster.Job[]Deprecated.UsegetAllJobStatuses()instead.Get job status for all jobs in the cluster.Get blacklisted trackers.getChildQueues(String queueName) Returns immediate children of queueName.Get current cluster status.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier>getDelegationToken(Text renewer) Get a delegation token for the user from the JobTracker.Get the file system where job-specific files are storedGet job corresponding to jobid.getJobHistoryUrl(JobID jobId) Get the job history file path for a given job id.Get the JobTracker's status.org.apache.hadoop.mapreduce.v2.LogParamsgetLogParams(JobID jobID, TaskAttemptID taskAttemptID) Get log parameters for the specified jobID or taskAttemptIDGet queue information for the specified name.Gets the Queue ACLs for current userGet all the queues in cluster.Gets the root level queues.Grab the jobtracker's view of the staging directory path where job-specific files will be placed.Grab the jobtracker system directory path where job-specific files will be placed.longGet the tasktracker expiry interval for the clusterlongrenewDelegationToken(Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> token) Deprecated.
-
Constructor Details
-
Cluster
- Throws:
IOException
-
Cluster
- Throws:
IOException
-
-
Method Details
-
close
Close theCluster.- Throws:
IOException
-
getFileSystem
Get the file system where job-specific files are stored- Returns:
- object of FileSystem
- Throws:
IOExceptionInterruptedException
-
getJob
Get job corresponding to jobid.- Parameters:
jobId-- Returns:
- object of
Job - Throws:
IOExceptionInterruptedException
-
getQueues
Get all the queues in cluster.- Returns:
- array of
QueueInfo - Throws:
IOExceptionInterruptedException
-
getQueue
Get queue information for the specified name.- Parameters:
name- queuename- Returns:
- object of
QueueInfo - Throws:
IOExceptionInterruptedException
-
getLogParams
public org.apache.hadoop.mapreduce.v2.LogParams getLogParams(JobID jobID, TaskAttemptID taskAttemptID) throws IOException, InterruptedException Get log parameters for the specified jobID or taskAttemptID- Parameters:
jobID- the job id.taskAttemptID- the task attempt id. Optional.- Returns:
- the LogParams
- Throws:
IOExceptionInterruptedException
-
getClusterStatus
Get current cluster status.- Returns:
- object of
ClusterMetrics - Throws:
IOExceptionInterruptedException
-
getActiveTaskTrackers
Get all active trackers in the cluster.- Returns:
- array of
TaskTrackerInfo - Throws:
IOExceptionInterruptedException
-
getBlackListedTaskTrackers
Get blacklisted trackers.- Returns:
- array of
TaskTrackerInfo - Throws:
IOExceptionInterruptedException
-
getAllJobs
Deprecated.UsegetAllJobStatuses()instead.Get all the jobs in cluster.- Returns:
- array of
Job - Throws:
IOExceptionInterruptedException
-
getAllJobStatuses
Get job status for all jobs in the cluster.- Returns:
- job status for all jobs in cluster
- Throws:
IOExceptionInterruptedException
-
getSystemDir
Grab the jobtracker system directory path where job-specific files will be placed.- Returns:
- the system directory where job-specific files are to be placed.
- Throws:
IOExceptionInterruptedException
-
getStagingAreaDir
Grab the jobtracker's view of the staging directory path where job-specific files will be placed.- Returns:
- the staging directory where job-specific files are to be placed.
- Throws:
IOExceptionInterruptedException
-
getJobHistoryUrl
Get the job history file path for a given job id. The job history file at this path may or may not be existing depending on the job completion state. The file is present only for the completed jobs.- Parameters:
jobId- the JobID of the job submitted by the current user.- Returns:
- the file path of the job history file
- Throws:
IOExceptionInterruptedException
-
getQueueAclsForCurrentUser
Gets the Queue ACLs for current user- Returns:
- array of QueueAclsInfo object for current user.
- Throws:
IOExceptionInterruptedException
-
getRootQueues
Gets the root level queues.- Returns:
- array of JobQueueInfo object.
- Throws:
IOExceptionInterruptedException
-
getChildQueues
Returns immediate children of queueName.- Parameters:
queueName-- Returns:
- array of JobQueueInfo which are children of queueName
- Throws:
IOExceptionInterruptedException
-
getJobTrackerStatus
Get the JobTracker's status.- Returns:
Cluster.JobTrackerStatusof the JobTracker- Throws:
IOExceptionInterruptedException
-
getTaskTrackerExpiryInterval
Get the tasktracker expiry interval for the cluster- Returns:
- the expiry interval in msec
- Throws:
IOExceptionInterruptedException
-
getDelegationToken
public Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException Get a delegation token for the user from the JobTracker.- Parameters:
renewer- the user who can renew the token- Returns:
- the new token
- Throws:
IOExceptionInterruptedException
-
renewDelegationToken
public long renewDelegationToken(Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> token) throws org.apache.hadoop.security.token.SecretManager.InvalidToken, IOException, InterruptedException Deprecated.Renew a delegation token- Parameters:
token- the token to renew- Returns:
- the new expiration time
- Throws:
org.apache.hadoop.security.token.SecretManager.InvalidTokenIOExceptionInterruptedException
-
cancelDelegationToken
public void cancelDelegationToken(Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> token) throws IOException, InterruptedException Deprecated.Cancel a delegation token from the JobTracker- Parameters:
token- the token to cancel- Throws:
IOExceptionInterruptedException
-
Token.cancel(org.apache.hadoop.conf.Configuration)instead