public class ShareLibService extends java.lang.Object implements Service, Instrumentable
| Modifier and Type | Field and Description |
|---|---|
static java.text.SimpleDateFormat |
dateFormat |
static java.lang.String |
FAIL_FAST_ON_STARTUP |
static java.lang.String |
LAUNCHER_LIB_PREFIX |
static java.lang.String |
LAUNCHERJAR_LIB_RETENTION |
static java.lang.String |
PURGE_INTERVAL |
static java.lang.String |
SHARE_LIB_CONF_PREFIX |
static java.lang.String |
SHARE_LIB_PREFIX |
static java.lang.String |
SHARELIB_MAPPING_FILE |
static java.lang.String |
SHIP_LAUNCHER_JAR |
CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout| Constructor and Description |
|---|
ShareLibService() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the service.
|
protected java.lang.String |
findContainingJar(java.lang.Class clazz)
Find containing jar containing.
|
org.apache.hadoop.fs.FileSystem |
getFileSystem()
Returns file system for shared libraries.
|
java.lang.Class<? extends Service> |
getInterface()
Return the public interface of the service.
|
org.apache.hadoop.fs.Path |
getLatestLibPath(org.apache.hadoop.fs.Path rootDir,
java.lang.String prefix)
Gets the Latest lib path.
|
java.util.Map<java.lang.String,java.util.List<org.apache.hadoop.fs.Path>> |
getShareLib() |
org.apache.hadoop.conf.Configuration |
getShareLibConf(java.lang.String inputKey,
org.apache.hadoop.fs.Path path) |
java.util.Map<java.lang.String,java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.conf.Configuration>> |
getShareLibConfigMap() |
java.util.List<org.apache.hadoop.fs.Path> |
getShareLibJars(java.lang.String shareLibKey)
Gets the action sharelib lib jars.
|
java.util.List<org.apache.hadoop.fs.Path> |
getSystemLibJars(java.lang.String shareLibKey)
Gets the launcher jars.
|
void |
init(Services services)
Initialize the service.
|
void |
instrument(Instrumentation instr)
Instruments the log service.
|
java.util.Map<java.lang.String,java.lang.String> |
updateShareLib()
Update share lib cache.
|
public static final java.lang.String LAUNCHERJAR_LIB_RETENTION
public static final java.lang.String SHARELIB_MAPPING_FILE
public static final java.lang.String SHIP_LAUNCHER_JAR
public static final java.lang.String PURGE_INTERVAL
public static final java.lang.String FAIL_FAST_ON_STARTUP
public static final java.lang.String LAUNCHER_LIB_PREFIX
public static final java.lang.String SHARE_LIB_PREFIX
public static final java.text.SimpleDateFormat dateFormat
public static java.lang.String SHARE_LIB_CONF_PREFIX
public ShareLibService()
public void init(Services services) throws ServiceException
ServiceService singleton at start up time.init in interface Serviceservices - services singleton initializing the service.ServiceException - thrown if the service could not initialize.public java.util.Map<java.lang.String,java.util.List<org.apache.hadoop.fs.Path>> getShareLib()
public java.util.List<org.apache.hadoop.fs.Path> getShareLibJars(java.lang.String shareLibKey) throws java.io.IOException
shareLibKey - the sharelib keyjava.io.IOException - Signals that an I/O exception has occurred.public java.util.List<org.apache.hadoop.fs.Path> getSystemLibJars(java.lang.String shareLibKey) throws java.io.IOException
shareLibKey - the shareLib keyjava.io.IOException - Signals that an I/O exception has occurred.protected java.lang.String findContainingJar(java.lang.Class clazz)
clazz - the clazzpublic void destroy()
ServiceService singleton at shutdown time.public java.lang.Class<? extends Service> getInterface()
ServicegetInterface in interface Servicepublic java.util.Map<java.lang.String,java.lang.String> updateShareLib() throws java.io.IOException
java.io.IOException - Signals that an I/O exception has occurred.public org.apache.hadoop.fs.Path getLatestLibPath(org.apache.hadoop.fs.Path rootDir, java.lang.String prefix) throws java.io.IOException
rootDir - the root dirprefix - the prefixjava.io.IOException - Signals that an I/O exception has occurred.public void instrument(Instrumentation instr)
instrument in interface Instrumentableinstr - instrumentation to use.public org.apache.hadoop.fs.FileSystem getFileSystem()
public org.apache.hadoop.conf.Configuration getShareLibConf(java.lang.String inputKey, org.apache.hadoop.fs.Path path)
public java.util.Map<java.lang.String,java.util.Map<org.apache.hadoop.fs.Path,org.apache.hadoop.conf.Configuration>> getShareLibConfigMap()
Copyright © 2017 Apache Software Foundation. All Rights Reserved.