public class AuxServices extends org.apache.hadoop.service.AbstractService implements org.apache.hadoop.service.ServiceStateChangeListener, org.apache.hadoop.yarn.event.EventHandler<AuxServicesEvent>
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_NAME |
static String |
NM_AUX_SERVICE_DIR |
static org.apache.hadoop.fs.permission.FsPermission |
NM_AUX_SERVICE_DIR_PERM |
static String |
SYSTEM_CLASSES |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addService(String name,
org.apache.hadoop.yarn.server.api.AuxiliaryService service,
AuxServiceRecord serviceRecord)
Adds a service to the service map.
|
Map<String,ByteBuffer> |
getMetaData() |
Collection<AuxServiceRecord> |
getServiceRecords()
Gets current aux service records.
|
void |
handle(AuxServicesEvent event) |
boolean |
isManifestEnabled()
Returns whether aux services manifest / dynamic loading is enabled.
|
protected void |
loadManifest(org.apache.hadoop.conf.Configuration conf,
boolean startServices)
Updates current aux services based on changes found in the manifest.
|
protected org.apache.hadoop.fs.Path |
maybeDownloadJars(String sName,
String className,
String remoteFile,
AuxServiceFile.TypeEnum type,
org.apache.hadoop.conf.Configuration conf)
Copies the specified remote file to local NM aux service directory.
|
protected static AuxServiceRecord |
newAuxService(String name,
String className) |
void |
reload(AuxServiceRecords services)
Reloads auxiliary services.
|
protected void |
reloadManifest()
Reloads auxiliary services manifest.
|
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
void |
serviceStart() |
void |
serviceStop() |
protected static void |
setClasspath(AuxServiceRecord service,
String classpath) |
protected static void |
setSystemClasses(AuxServiceRecord service,
String systemClasses) |
void |
stateChanged(org.apache.hadoop.service.Service service) |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final String NM_AUX_SERVICE_DIR
public static final org.apache.hadoop.fs.permission.FsPermission NM_AUX_SERVICE_DIR_PERM
public static final String CLASS_NAME
public static final String SYSTEM_CLASSES
public boolean isManifestEnabled()
protected final void addService(String name, org.apache.hadoop.yarn.server.api.AuxiliaryService service, AuxServiceRecord serviceRecord)
name - aux service nameservice - aux serviceserviceRecord - aux service recordpublic Collection<AuxServiceRecord> getServiceRecords()
public Map<String,ByteBuffer> getMetaData()
protected org.apache.hadoop.fs.Path maybeDownloadJars(String sName, String className, String remoteFile, AuxServiceFile.TypeEnum type, org.apache.hadoop.conf.Configuration conf) throws IOException
sName - service nameclassName - service class nameremoteFile - location of the file to downloadtype - type of file (STATIC for a jar or ARCHIVE for a tarball)conf - configurationIOExceptionprotected void reloadManifest()
throws IOException
IOException - if manifest can't be loadedpublic void reload(AuxServiceRecords services) throws IOException
services - a list of auxiliary servicesIOException - if aux services have not been started yet or dynamic
reloading is not enabledprotected void loadManifest(org.apache.hadoop.conf.Configuration conf,
boolean startServices)
throws IOException
conf - configurationstartServices - if true starts services, otherwise only inits servicesIOExceptionpublic void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionpublic void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionpublic void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionpublic void stateChanged(org.apache.hadoop.service.Service service)
stateChanged in interface org.apache.hadoop.service.ServiceStateChangeListenerpublic void handle(AuxServicesEvent event)
handle in interface org.apache.hadoop.yarn.event.EventHandler<AuxServicesEvent>protected static AuxServiceRecord newAuxService(String name, String className)
protected static void setClasspath(AuxServiceRecord service, String classpath)
protected static void setSystemClasses(AuxServiceRecord service, String systemClasses)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.