com.cloudera.lib.service.hadoop
Class HadoopService
java.lang.Object
com.cloudera.lib.server.BaseService
com.cloudera.lib.service.hadoop.HadoopService
- All Implemented Interfaces:
- Service, Hadoop
public class HadoopService
- extends BaseService
- implements Hadoop
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
AUTHENTICATION_TYPE
public static final String AUTHENTICATION_TYPE
- See Also:
- Constant Field Values
KERBEROS_KEYTAB
public static final String KERBEROS_KEYTAB
- See Also:
- Constant Field Values
KERBEROS_PRINCIPAL
public static final String KERBEROS_PRINCIPAL
- See Also:
- Constant Field Values
JOB_TRACKER_WHITELIST
public static final String JOB_TRACKER_WHITELIST
- See Also:
- Constant Field Values
NAME_NODE_WHITELIST
public static final String NAME_NODE_WHITELIST
- See Also:
- Constant Field Values
HadoopService
public HadoopService()
init
protected void init()
throws ServiceException
- Description copied from class:
BaseService
- Initializes the server.
This method is called by
BaseService.init(Server)
after all service properties
(properties prefixed with
- Specified by:
init
in class BaseService
- Throws:
ServiceException
- thrown if the service could not be initialized.
postInit
public void postInit()
throws ServiceException
- Description copied from class:
BaseService
- Post initializes the service. This method is called by the
Server
after all services of the server have been initialized.
This method does a NOP.
- Specified by:
postInit
in interface Service
- Overrides:
postInit
in class BaseService
- Throws:
ServiceException
- thrown if the service could not be
post-initialized.
getInterface
public Class getInterface()
- Description copied from interface:
Service
- Returns the interface implemented by this service. This interface is used
the
Server
when the Server.get(Class)
method is used to
retrieve a service.
- Specified by:
getInterface
in interface Service
- Returns:
- the interface that identifies the service.
getServiceDependencies
public Class[] getServiceDependencies()
- Description copied from class:
BaseService
- Returns the service dependencies of this service. The service will be
instantiated only if all the service dependencies are already initialized.
This method returns an empty array (size 0)
- Specified by:
getServiceDependencies
in interface Service
- Overrides:
getServiceDependencies
in class BaseService
- Returns:
- an empty array (size 0).
getUGI
protected org.apache.hadoop.security.UserGroupInformation getUGI(String user)
throws IOException
- Throws:
IOException
setRequiredServiceHadoopConf
protected void setRequiredServiceHadoopConf(org.apache.hadoop.conf.Configuration conf)
createHadoopConf
protected org.apache.hadoop.mapred.JobConf createHadoopConf(org.apache.hadoop.conf.Configuration conf)
createJobTrackerConf
protected org.apache.hadoop.mapred.JobConf createJobTrackerConf(org.apache.hadoop.conf.Configuration conf)
createNameNodeConf
protected org.apache.hadoop.conf.Configuration createNameNodeConf(org.apache.hadoop.conf.Configuration conf)
createFileSystem
protected org.apache.hadoop.fs.FileSystem createFileSystem(org.apache.hadoop.conf.Configuration namenodeConf)
throws IOException
- Throws:
IOException
closeFileSystem
protected void closeFileSystem(org.apache.hadoop.fs.FileSystem fs)
throws IOException
- Throws:
IOException
createJobClient
protected org.apache.hadoop.mapred.JobClient createJobClient(org.apache.hadoop.mapred.JobConf jobtrackerConf)
throws IOException
- Throws:
IOException
closeJobClient
protected void closeJobClient(org.apache.hadoop.mapred.JobClient jobClient)
throws IOException
- Throws:
IOException
validateJobtracker
protected void validateJobtracker(String jobtracker)
throws HadoopException
- Throws:
HadoopException
validateNamenode
protected void validateNamenode(String namenode)
throws HadoopException
- Throws:
HadoopException
checkJobTrackerHealth
protected void checkJobTrackerHealth(org.apache.hadoop.mapred.JobClient jobClient)
throws HadoopException
- Throws:
HadoopException
checkNameNodeHealth
protected void checkNameNodeHealth(org.apache.hadoop.fs.FileSystem fileSystem)
throws HadoopException
- Throws:
HadoopException
execute
public <T> T execute(String user,
org.apache.hadoop.conf.Configuration conf,
Hadoop.FileSystemExecutor<T> executor)
throws HadoopException
- Specified by:
execute
in interface Hadoop
- Throws:
HadoopException
execute
public <T> T execute(String user,
org.apache.hadoop.conf.Configuration conf,
Hadoop.JobClientExecutor<T> executor)
throws HadoopException
- Specified by:
execute
in interface Hadoop
- Throws:
HadoopException
createFileSystemInternal
public org.apache.hadoop.fs.FileSystem createFileSystemInternal(String user,
org.apache.hadoop.conf.Configuration conf)
throws IOException,
HadoopException
- Throws:
IOException
HadoopException
createFileSystem
public org.apache.hadoop.fs.FileSystem createFileSystem(String user,
org.apache.hadoop.conf.Configuration conf)
throws IOException,
HadoopException
- Specified by:
createFileSystem
in interface Hadoop
- Throws:
IOException
HadoopException
releaseFileSystem
public void releaseFileSystem(org.apache.hadoop.fs.FileSystem fs)
throws IOException
- Specified by:
releaseFileSystem
in interface Hadoop
- Throws:
IOException
getDefaultConfiguration
public org.apache.hadoop.conf.Configuration getDefaultConfiguration()
- Specified by:
getDefaultConfiguration
in interface Hadoop
Copyright © 2012 Cloudera. All Rights Reserved.