Class AHSv2ClientImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.records.ApplicationAttemptReportgetApplicationAttemptReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) Get a report of the given ApplicationAttempt.List<org.apache.hadoop.yarn.api.records.ApplicationAttemptReport>getApplicationAttempts(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Get a report of all (ApplicationAttempts) of Application in the cluster.org.apache.hadoop.yarn.api.records.ApplicationReportgetApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId appId) Get a report of the given Application.List<org.apache.hadoop.yarn.api.records.ApplicationReport>Get a report (ApplicationReport) of all Applications in the cluster.org.apache.hadoop.yarn.api.records.ContainerReportgetContainerReport(org.apache.hadoop.yarn.api.records.ContainerId containerId) Get a report of the given Container.List<org.apache.hadoop.yarn.api.records.ContainerReport>getContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) Get a report of all (Containers) of ApplicationAttempt in the cluster.voidserviceInit(org.apache.hadoop.conf.Configuration conf) voidvoidprotected voidsetReaderClient(org.apache.hadoop.yarn.client.api.TimelineReaderClient readerClient) Methods inherited from class org.apache.hadoop.yarn.client.api.AHSClient
createAHSClient, createAHSv2ClientMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
AHSv2ClientImpl
public AHSv2ClientImpl()
-
-
Method Details
-
serviceInit
public void serviceInit(org.apache.hadoop.conf.Configuration conf) - Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService
-
setReaderClient
@VisibleForTesting protected void setReaderClient(org.apache.hadoop.yarn.client.api.TimelineReaderClient readerClient) -
serviceStart
public void serviceStart()- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService
-
serviceStop
public void serviceStop()- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService
-
getApplicationReport
public org.apache.hadoop.yarn.api.records.ApplicationReport getApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Description copied from class:AHSClientGet a report of the given Application.In secure mode,
YARNverifies access to the application, queue etc. before accepting the request.If the user does not have
VIEW_APPaccess then the following fields in the report will be set to stubbed values:- host - set to "N/A"
- RPC port - set to -1
- client token - set to "N/A"
- diagnostics - set to "N/A"
- tracking URL - set to "N/A"
- original tracking URL - set to "N/A"
- resource usage report - all values are -1
- Specified by:
getApplicationReportin classAHSClient- Parameters:
appId-ApplicationIdof the application that needs a report- Returns:
- application report
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getApplications
public List<org.apache.hadoop.yarn.api.records.ApplicationReport> getApplications() throws org.apache.hadoop.yarn.exceptions.YarnException, IOExceptionDescription copied from class:AHSClientGet a report (ApplicationReport) of all Applications in the cluster.
If the user does not have
VIEW_APPaccess for an application then the corresponding report will be filtered as described inAHSClient.getApplicationReport(ApplicationId).- Specified by:
getApplicationsin classAHSClient- Returns:
- a list of reports for all applications
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getApplicationAttemptReport
public org.apache.hadoop.yarn.api.records.ApplicationAttemptReport getApplicationAttemptReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Description copied from class:AHSClientGet a report of the given ApplicationAttempt.
In secure mode,
YARNverifies access to the application, queue etc. before accepting the request.- Specified by:
getApplicationAttemptReportin classAHSClient- Parameters:
applicationAttemptId-ApplicationAttemptIdof the application attempt that needs a report- Returns:
- application attempt report
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionorg.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException- if application attempt not foundIOException
-
getApplicationAttempts
public List<org.apache.hadoop.yarn.api.records.ApplicationAttemptReport> getApplicationAttempts(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Description copied from class:AHSClientGet a report of all (ApplicationAttempts) of Application in the cluster.
- Specified by:
getApplicationAttemptsin classAHSClient- Returns:
- a list of reports for all application attempts for specified application
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getContainerReport
public org.apache.hadoop.yarn.api.records.ContainerReport getContainerReport(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Description copied from class:AHSClientGet a report of the given Container.
In secure mode,
YARNverifies access to the application, queue etc. before accepting the request.- Specified by:
getContainerReportin classAHSClient- Parameters:
containerId-ContainerIdof the container that needs a report- Returns:
- container report
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionorg.apache.hadoop.yarn.exceptions.ContainerNotFoundException- if container not foundIOException
-
getContainers
public List<org.apache.hadoop.yarn.api.records.ContainerReport> getContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException Description copied from class:AHSClientGet a report of all (Containers) of ApplicationAttempt in the cluster.
- Specified by:
getContainersin classAHSClient- Returns:
- a list of reports of all containers for specified application attempt
- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-