Class RemoteAppChecker
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker
org.apache.hadoop.yarn.server.sharedcachemanager.RemoteAppChecker
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
An implementation of AppChecker that queries the resource manager remotely to
determine whether the app is running.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
Fields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<org.apache.hadoop.yarn.api.records.ApplicationId>Returns the list of all active apps at the given time.booleanisApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationId id) Returns whether the app is in an active state.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceStart, serviceStopMethods 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
-
RemoteAppChecker
public RemoteAppChecker()
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
isApplicationActive
@Private public boolean isApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationId id) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:AppCheckerReturns whether the app is in an active state.- Specified by:
isApplicationActivein classAppChecker- Returns:
- true if the app is found and is not in one of the completed states; false otherwise
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if there is an error in determining the app state
-
getActiveApplications
@Private public Collection<org.apache.hadoop.yarn.api.records.ApplicationId> getActiveApplications() throws org.apache.hadoop.yarn.exceptions.YarnExceptionDescription copied from class:AppCheckerReturns the list of all active apps at the given time.- Specified by:
getActiveApplicationsin classAppChecker- Returns:
- the list of active apps, or an empty list if there is none
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if there is an error in obtaining the list
-