@InterfaceAudience.Private public class FileSystemAccessService extends BaseService implements FileSystemAccess
FileSystemAccess.FileSystemExecutor<T>
Modifier and Type | Field and Description |
---|---|
static String |
AUTHENTICATION_TYPE |
static String |
FS_CACHE_PURGE_FREQUENCY |
static String |
FS_CACHE_PURGE_TIMEOUT |
static String |
HADOOP_CONF_DIR |
static String |
KERBEROS_KEYTAB |
static String |
KERBEROS_PRINCIPAL |
static String |
NAME_NODE_WHITELIST |
static String |
PREFIX |
Constructor and Description |
---|
FileSystemAccessService() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNameNodeHealth(org.apache.hadoop.fs.FileSystem fileSystem) |
protected void |
closeFileSystem(org.apache.hadoop.fs.FileSystem fs) |
protected org.apache.hadoop.fs.FileSystem |
createFileSystem(org.apache.hadoop.conf.Configuration namenodeConf) |
org.apache.hadoop.fs.FileSystem |
createFileSystem(String user,
org.apache.hadoop.conf.Configuration conf) |
org.apache.hadoop.fs.FileSystem |
createFileSystemInternal(String user,
org.apache.hadoop.conf.Configuration conf) |
<T> T |
execute(String user,
org.apache.hadoop.conf.Configuration conf,
FileSystemAccess.FileSystemExecutor<T> executor) |
org.apache.hadoop.conf.Configuration |
getFileSystemConfiguration() |
Class |
getInterface()
Returns the interface implemented by this service.
|
Class[] |
getServiceDependencies()
Returns the service dependencies of this service.
|
protected org.apache.hadoop.security.UserGroupInformation |
getUGI(String user) |
protected void |
init()
Initializes the server.
|
void |
postInit()
Post initializes the service.
|
void |
releaseFileSystem(org.apache.hadoop.fs.FileSystem fs) |
protected void |
setRequiredServiceHadoopConf(org.apache.hadoop.conf.Configuration conf) |
protected void |
validateNamenode(String namenode) |
destroy, getPrefix, getPrefixedName, getServer, getServiceConfig, init, serverStatusChange
public static final String PREFIX
public static final String AUTHENTICATION_TYPE
public static final String KERBEROS_KEYTAB
public static final String KERBEROS_PRINCIPAL
public static final String FS_CACHE_PURGE_FREQUENCY
public static final String FS_CACHE_PURGE_TIMEOUT
public static final String NAME_NODE_WHITELIST
public static final String HADOOP_CONF_DIR
protected void init() throws ServiceException
BaseService
This method is called by BaseService.init(Server)
after all service properties
(properties prefixed with
init
in class BaseService
ServiceException
- thrown if the service could not be initialized.public void postInit() throws ServiceException
BaseService
Server
after all services of the server have been initialized.
This method does a NOP.
postInit
in interface Service
postInit
in class BaseService
ServiceException
- thrown if the service could not be
post-initialized.public Class getInterface()
Service
Server
when the Server.get(Class)
method is used to
retrieve a service.getInterface
in interface Service
public Class[] getServiceDependencies()
BaseService
This method returns an empty array (size 0)
getServiceDependencies
in interface Service
getServiceDependencies
in class BaseService
protected org.apache.hadoop.security.UserGroupInformation getUGI(String user) throws IOException
IOException
protected void setRequiredServiceHadoopConf(org.apache.hadoop.conf.Configuration conf)
protected org.apache.hadoop.fs.FileSystem createFileSystem(org.apache.hadoop.conf.Configuration namenodeConf) throws IOException
IOException
protected void closeFileSystem(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
protected void validateNamenode(String namenode) throws FileSystemAccessException
FileSystemAccessException
protected void checkNameNodeHealth(org.apache.hadoop.fs.FileSystem fileSystem) throws FileSystemAccessException
FileSystemAccessException
public <T> T execute(String user, org.apache.hadoop.conf.Configuration conf, FileSystemAccess.FileSystemExecutor<T> executor) throws FileSystemAccessException
execute
in interface FileSystemAccess
FileSystemAccessException
public org.apache.hadoop.fs.FileSystem createFileSystemInternal(String user, org.apache.hadoop.conf.Configuration conf) throws IOException, FileSystemAccessException
IOException
FileSystemAccessException
public org.apache.hadoop.fs.FileSystem createFileSystem(String user, org.apache.hadoop.conf.Configuration conf) throws IOException, FileSystemAccessException
createFileSystem
in interface FileSystemAccess
IOException
FileSystemAccessException
public void releaseFileSystem(org.apache.hadoop.fs.FileSystem fs) throws IOException
releaseFileSystem
in interface FileSystemAccess
IOException
public org.apache.hadoop.conf.Configuration getFileSystemConfiguration()
getFileSystemConfiguration
in interface FileSystemAccess
Copyright © 2022 Apache Software Foundation. All rights reserved.