org.apache.hadoop.lib.service.hadoop
Class FileSystemAccessService

java.lang.Object
  extended by org.apache.hadoop.lib.server.BaseService
      extended by org.apache.hadoop.lib.service.hadoop.FileSystemAccessService
All Implemented Interfaces:
Service, FileSystemAccess

@InterfaceAudience.Private
public class FileSystemAccessService
extends BaseService
implements FileSystemAccess


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.lib.service.FileSystemAccess
FileSystemAccess.FileSystemExecutor<T>
 
Field Summary
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 Summary
FileSystemAccessService()
           
 
Method Summary
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)
           
 
Methods inherited from class org.apache.hadoop.lib.server.BaseService
destroy, getPrefix, getPrefixedName, getServer, getServiceConfig, init, serverStatusChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

FileSystemAccessService

public FileSystemAccessService()
Method Detail

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.