Class FileSystemAccessService
java.lang.Object
org.apache.hadoop.lib.server.BaseService
org.apache.hadoop.lib.service.hadoop.FileSystemAccessService
- All Implemented Interfaces:
Service,FileSystemAccess
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.lib.service.FileSystemAccess
FileSystemAccess.FileSystemExecutor<T> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckNameNodeHealth(org.apache.hadoop.fs.FileSystem fileSystem) protected voidcloseFileSystem(org.apache.hadoop.fs.FileSystem fs) org.apache.hadoop.fs.FileSystemcreateFileSystem(String user, org.apache.hadoop.conf.Configuration conf) protected org.apache.hadoop.fs.FileSystemcreateFileSystem(org.apache.hadoop.conf.Configuration namenodeConf) org.apache.hadoop.fs.FileSystemcreateFileSystemInternal(String user, org.apache.hadoop.conf.Configuration conf) <T> Texecute(String user, org.apache.hadoop.conf.Configuration conf, FileSystemAccess.FileSystemExecutor<T> executor) org.apache.hadoop.conf.ConfigurationReturns the interface implemented by this service.Class[]Returns the service dependencies of this service.protected org.apache.hadoop.security.UserGroupInformationprotected voidinit()Initializes the server.voidpostInit()Post initializes the service.voidreleaseFileSystem(org.apache.hadoop.fs.FileSystem fs) protected voidsetRequiredServiceHadoopConf(org.apache.hadoop.conf.Configuration conf) protected voidvalidateNamenode(String namenode) Methods inherited from class org.apache.hadoop.lib.server.BaseService
destroy, getPrefix, getPrefixedName, getServer, getServiceConfig, init, serverStatusChange
-
Field Details
-
PREFIX
- See Also:
-
AUTHENTICATION_TYPE
- See Also:
-
KERBEROS_KEYTAB
- See Also:
-
KERBEROS_PRINCIPAL
- See Also:
-
FS_CACHE_PURGE_FREQUENCY
- See Also:
-
FS_CACHE_PURGE_TIMEOUT
- See Also:
-
NAME_NODE_WHITELIST
- See Also:
-
HADOOP_CONF_DIR
- See Also:
-
-
Constructor Details
-
FileSystemAccessService
public FileSystemAccessService()
-
-
Method Details
-
init
Description copied from class:BaseServiceInitializes the server.This method is called by
BaseService.init(Server)after all service properties (properties prefixed with- Specified by:
initin classBaseService- Throws:
ServiceException- thrown if the service could not be initialized.
-
postInit
Description copied from class:BaseServicePost initializes the service. This method is called by theServerafter all services of the server have been initialized.This method does a NOP.
- Specified by:
postInitin interfaceService- Overrides:
postInitin classBaseService- Throws:
ServiceException- thrown if the service could not be post-initialized.
-
getInterface
Description copied from interface:ServiceReturns the interface implemented by this service. This interface is used theServerwhen theServer.get(Class)method is used to retrieve a service.- Specified by:
getInterfacein interfaceService- Returns:
- the interface that identifies the service.
-
getServiceDependencies
Description copied from class:BaseServiceReturns 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:
getServiceDependenciesin interfaceService- Overrides:
getServiceDependenciesin classBaseService- Returns:
- an empty array (size 0).
-
getUGI
- 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
- Throws:
IOException
-
validateNamenode
- 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:
executein interfaceFileSystemAccess- Throws:
FileSystemAccessException
-
createFileSystemInternal
public org.apache.hadoop.fs.FileSystem createFileSystemInternal(String user, org.apache.hadoop.conf.Configuration conf) throws IOException, FileSystemAccessException - Throws:
IOExceptionFileSystemAccessException
-
createFileSystem
public org.apache.hadoop.fs.FileSystem createFileSystem(String user, org.apache.hadoop.conf.Configuration conf) throws IOException, FileSystemAccessException - Specified by:
createFileSystemin interfaceFileSystemAccess- Throws:
IOExceptionFileSystemAccessException
-
releaseFileSystem
- Specified by:
releaseFileSystemin interfaceFileSystemAccess- Throws:
IOException
-
getFileSystemConfiguration
public org.apache.hadoop.conf.Configuration getFileSystemConfiguration()- Specified by:
getFileSystemConfigurationin interfaceFileSystemAccess
-