java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, org.apache.hadoop.service.ServiceStateChangeListener, org.apache.hadoop.yarn.event.EventHandler<AuxServicesEvent>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 | Description |
|---|---|---|
static java.lang.String |
CLASS_NAME |
|
static java.lang.String |
NM_AUX_SERVICE_DIR |
|
static org.apache.hadoop.fs.permission.FsPermission |
NM_AUX_SERVICE_DIR_PERM |
|
static java.lang.String |
SYSTEM_CLASSES |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addService(java.lang.String name,
org.apache.hadoop.yarn.server.api.AuxiliaryService service,
AuxServiceRecord serviceRecord) |
Adds a service to the service map.
|
java.util.Map<java.lang.String,java.nio.ByteBuffer> |
getMetaData() |
|
java.util.Map<java.lang.String,java.nio.ByteBuffer> |
getMetaData(org.apache.hadoop.yarn.server.api.ContainerInitializationContext ctx) |
|
java.util.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(java.lang.String sName,
java.lang.String className,
java.lang.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(java.lang.String name,
java.lang.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,
java.lang.String classpath) |
|
protected static void |
setSystemClasses(AuxServiceRecord service,
java.lang.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 java.lang.String NM_AUX_SERVICE_DIR
public static final org.apache.hadoop.fs.permission.FsPermission NM_AUX_SERVICE_DIR_PERM
public static final java.lang.String CLASS_NAME
public static final java.lang.String SYSTEM_CLASSES
public boolean isManifestEnabled()
protected final void addService(java.lang.String name,
org.apache.hadoop.yarn.server.api.AuxiliaryService service,
AuxServiceRecord serviceRecord)
name - aux service nameservice - aux serviceserviceRecord - aux service recordpublic java.util.Collection<AuxServiceRecord> getServiceRecords()
public java.util.Map<java.lang.String,java.nio.ByteBuffer> getMetaData()
public java.util.Map<java.lang.String,java.nio.ByteBuffer> getMetaData(org.apache.hadoop.yarn.server.api.ContainerInitializationContext ctx)
@VisibleForTesting
protected org.apache.hadoop.fs.Path maybeDownloadJars(java.lang.String sName,
java.lang.String className,
java.lang.String remoteFile,
AuxServiceFile.TypeEnum type,
org.apache.hadoop.conf.Configuration conf)
throws java.io.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 - configurationjava.io.IOException@VisibleForTesting
protected void reloadManifest()
throws java.io.IOException
java.io.IOException - if manifest can't be loadedpublic void reload(AuxServiceRecords services) throws java.io.IOException
services - a list of auxiliary servicesjava.io.IOException - if aux services have not been started yet or dynamic
reloading is not enabled@VisibleForTesting
protected void loadManifest(org.apache.hadoop.conf.Configuration conf,
boolean startServices)
throws java.io.IOException
conf - configurationstartServices - if true starts services, otherwise only inits servicesjava.io.IOExceptionpublic void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic void serviceStart()
throws java.lang.Exception
serviceStart in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic void serviceStop()
throws java.lang.Exception
serviceStop in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic 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(java.lang.String name, java.lang.String className)
protected static void setClasspath(AuxServiceRecord service, java.lang.String classpath)
protected static void setSystemClasses(AuxServiceRecord service, java.lang.String systemClasses)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.