public class ShareLibService extends Object implements Service, Instrumentable
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
dateFormat |
static String |
FAIL_FAST_ON_STARTUP |
static String |
LAUNCHER_LIB_PREFIX |
static String |
LAUNCHERJAR_LIB_RETENTION |
static String |
PURGE_INTERVAL |
static String |
SHARE_LIB_CONF_PREFIX |
static String |
SHARE_LIB_PREFIX |
static String |
SHARELIB_MAPPING_FILE |
static 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 String |
findContainingJar(Class<?> clazz)
Find containing jar containing.
|
org.apache.hadoop.fs.FileSystem |
getFileSystem()
Returns file system for shared libraries.
|
Class<? extends Service> |
getInterface()
Return the public interface of the service.
|
org.apache.hadoop.fs.Path |
getLatestLibPath(org.apache.hadoop.fs.Path rootDir,
String prefix)
Gets the Latest lib path.
|
Map<String,List<org.apache.hadoop.fs.Path>> |
getShareLib() |
org.apache.hadoop.conf.Configuration |
getShareLibConf(String inputKey,
org.apache.hadoop.fs.Path path) |
Map<String,Map<org.apache.hadoop.fs.Path,org.apache.hadoop.conf.Configuration>> |
getShareLibConfigMap() |
List<org.apache.hadoop.fs.Path> |
getShareLibJars(String shareLibKey)
Gets the action sharelib lib jars.
|
List<org.apache.hadoop.fs.Path> |
getSystemLibJars(String shareLibKey)
Gets the launcher jars.
|
void |
init(Services services)
Initialize the service.
|
void |
instrument(Instrumentation instr)
Instruments the log service.
|
Map<String,String> |
updateShareLib()
Update share lib cache.
|
public static final String LAUNCHERJAR_LIB_RETENTION
public static final String SHARELIB_MAPPING_FILE
public static final String SHIP_LAUNCHER_JAR
public static final String PURGE_INTERVAL
public static final String FAIL_FAST_ON_STARTUP
public static final String LAUNCHER_LIB_PREFIX
public static final String SHARE_LIB_PREFIX
public static final SimpleDateFormat dateFormat
public static String SHARE_LIB_CONF_PREFIX
public ShareLibService()
public void init(Services services) throws ServiceException
Service
Invoked by the Service
singleton at start up time.
init
in interface Service
services
- services singleton initializing the service.ServiceException
- thrown if the service could not initialize.public Map<String,List<org.apache.hadoop.fs.Path>> getShareLib()
public List<org.apache.hadoop.fs.Path> getShareLibJars(String shareLibKey) throws IOException
shareLibKey
- the sharelib keyIOException
- Signals that an I/O exception has occurred.public List<org.apache.hadoop.fs.Path> getSystemLibJars(String shareLibKey) throws IOException
shareLibKey
- the shareLib keyIOException
- Signals that an I/O exception has occurred.protected String findContainingJar(Class<?> clazz)
clazz
- the clazzpublic void destroy()
Service
Invoked by the Service
singleton at shutdown time.
public Class<? extends Service> getInterface()
Service
Services are retrieved by its public interface. Specializations of services must return the public interface.
getInterface
in interface Service
public Map<String,String> updateShareLib() throws IOException
IOException
- Signals that an I/O exception has occurred.public org.apache.hadoop.fs.Path getLatestLibPath(org.apache.hadoop.fs.Path rootDir, String prefix) throws IOException
rootDir
- the root dirprefix
- the prefixIOException
- Signals that an I/O exception has occurred.public void instrument(Instrumentation instr)
It sets instrumentation variables indicating the location of the sharelib and launcherlib
instrument
in interface Instrumentable
instr
- instrumentation to use.public org.apache.hadoop.fs.FileSystem getFileSystem()
If WorkflowAppService#getSystemLibPath doesn't have authority then a default one assumed
public org.apache.hadoop.conf.Configuration getShareLibConf(String inputKey, org.apache.hadoop.fs.Path path)
public Map<String,Map<org.apache.hadoop.fs.Path,org.apache.hadoop.conf.Configuration>> getShareLibConfigMap()
Copyright © 2018 Apache Software Foundation. All rights reserved.