Class AppChecker
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
- Direct Known Subclasses:
RemoteAppChecker
@Private
@Evolving
public abstract class AppChecker
extends org.apache.hadoop.service.CompositeService
An interface for checking whether an app is running so that the cleaner
service may determine if it can safely remove a cached entry.
-
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 TypeMethodDescriptionabstract Collection<org.apache.hadoop.yarn.api.records.ApplicationId>Returns the list of all active apps at the given time.abstract booleanisApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationId id) Returns whether the app is in an active state.Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceInit, 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
-
AppChecker
public AppChecker() -
AppChecker
-
-
Method Details
-
isApplicationActive
@Private public abstract boolean isApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationId id) throws org.apache.hadoop.yarn.exceptions.YarnException Returns whether the app is in an active state.- 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 abstract Collection<org.apache.hadoop.yarn.api.records.ApplicationId> getActiveApplications() throws org.apache.hadoop.yarn.exceptions.YarnExceptionReturns the list of all active apps at the given time.- 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
-