org.apache.hadoop.lib.service.hadoop
Class FileSystemAccessService
java.lang.Object
org.apache.hadoop.lib.server.BaseService
org.apache.hadoop.lib.service.hadoop.FileSystemAccessService
- All Implemented Interfaces:
- Service, FileSystemAccess
@InterfaceAudience.Private
public class FileSystemAccessService
- extends BaseService
- implements FileSystemAccess
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
FS_CACHE_PURGE_FREQUENCY
public static final String FS_CACHE_PURGE_FREQUENCY
- See Also:
- Constant Field Values
FS_CACHE_PURGE_TIMEOUT
public static final String FS_CACHE_PURGE_TIMEOUT
- See Also:
- Constant Field Values
NAME_NODE_WHITELIST
public static final String NAME_NODE_WHITELIST
- See Also:
- Constant Field Values
HADOOP_CONF_DIR
public static final String HADOOP_CONF_DIR
- See Also:
- Constant Field Values
FileSystemAccessService
public FileSystemAccessService()
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)
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
validateNamenode
protected void validateNamenode(String namenode)
throws FileSystemAccessException
- Throws:
FileSystemAccessException
checkNameNodeHealth
protected void checkNameNodeHealth(org.apache.hadoop.fs.FileSystem fileSystem)
throws FileSystemAccessException
- Throws:
FileSystemAccessException
execute
public <T> T execute(String user,
org.apache.hadoop.conf.Configuration conf,
FileSystemAccess.FileSystemExecutor<T> executor)
throws FileSystemAccessException
- Specified by:
execute
in interface FileSystemAccess
- Throws:
FileSystemAccessException
createFileSystemInternal
public org.apache.hadoop.fs.FileSystem createFileSystemInternal(String user,
org.apache.hadoop.conf.Configuration conf)
throws IOException,
FileSystemAccessException
- Throws:
IOException
FileSystemAccessException
createFileSystem
public org.apache.hadoop.fs.FileSystem createFileSystem(String user,
org.apache.hadoop.conf.Configuration conf)
throws IOException,
FileSystemAccessException
- Specified by:
createFileSystem
in interface FileSystemAccess
- Throws:
IOException
FileSystemAccessException
releaseFileSystem
public void releaseFileSystem(org.apache.hadoop.fs.FileSystem fs)
throws IOException
- Specified by:
releaseFileSystem
in interface FileSystemAccess
- Throws:
IOException
getFileSystemConfiguration
public org.apache.hadoop.conf.Configuration getFileSystemConfiguration()
- Specified by:
getFileSystemConfiguration
in interface FileSystemAccess
Copyright © 2014 Apache Software Foundation. All Rights Reserved.