Class HdfsFileSystemConfigBuilder

java.lang.Object
org.apache.commons.vfs2.FileSystemConfigBuilder
org.apache.commons.vfs2.provider.hdfs.HdfsFileSystemConfigBuilder

public final class HdfsFileSystemConfigBuilder extends org.apache.commons.vfs2.FileSystemConfigBuilder
Configuration settings for the HdfsFileSystem.
Since:
2.1
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Class<? extends org.apache.commons.vfs2.FileSystem>
     
    org.apache.hadoop.conf.Configuration
    getConfigConfiguration(org.apache.commons.vfs2.FileSystemOptions opts)
    Gets the alternate configuration object.
    getConfigInputStream(org.apache.commons.vfs2.FileSystemOptions opts)
    Gets the alternate configuration input stream.
    getConfigNames(org.apache.commons.vfs2.FileSystemOptions opts)
    Gets the names of alternate configuration resources.
    org.apache.hadoop.fs.Path[]
    getConfigPaths(org.apache.commons.vfs2.FileSystemOptions opts)
    Gets the paths of alternate configuration file system files.
    URL[]
    getConfigURLs(org.apache.commons.vfs2.FileSystemOptions opts)
    Gets URLs of alternate configurations.
    Gets the singleton instance.
    void
    setConfigConfiguration(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.hadoop.conf.Configuration configuration)
    Sets the configuration object to be loaded after the defaults.
    void
    setConfigInputStream(org.apache.commons.vfs2.FileSystemOptions opts, InputStream inputStream)
    Sets the input stream of configuration file to be loaded after the defaults.
    void
    setConfigName(org.apache.commons.vfs2.FileSystemOptions opts, String name)
    Sets the name of configuration resource to be loaded after the defaults.
    void
    setConfigPath(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.hadoop.fs.Path path)
    Sets the full path of configuration file to be loaded after the defaults.
    void
    setConfigURL(org.apache.commons.vfs2.FileSystemOptions opts, URL url)
    Sets the URL of configuration file to be loaded after the defaults.

    Methods inherited from class org.apache.commons.vfs2.FileSystemConfigBuilder

    getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getDuration, getDuration, getDurationInteger, getDurationInteger, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getParamOrDefault, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      Gets the singleton instance.
      Returns:
      HdfsFileSystemConfigBuilder instance
    • getConfigClass

      protected Class<? extends org.apache.commons.vfs2.FileSystem> getConfigClass()
      Specified by:
      getConfigClass in class org.apache.commons.vfs2.FileSystemConfigBuilder
      Returns:
      HDFSFileSystem
    • getConfigConfiguration

      public org.apache.hadoop.conf.Configuration getConfigConfiguration(org.apache.commons.vfs2.FileSystemOptions opts)
      Gets the alternate configuration object.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      alternate configuration object or null.
      See Also:
    • getConfigInputStream

      public InputStream getConfigInputStream(org.apache.commons.vfs2.FileSystemOptions opts)
      Gets the alternate configuration input stream.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      alternate configuration input stream or null.
      See Also:
    • getConfigNames

      public String[] getConfigNames(org.apache.commons.vfs2.FileSystemOptions opts)
      Gets the names of alternate configuration resources.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      resource name list of alternate configurations or null.
      See Also:
    • getConfigPaths

      public org.apache.hadoop.fs.Path[] getConfigPaths(org.apache.commons.vfs2.FileSystemOptions opts)
      Gets the paths of alternate configuration file system files.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      list of full paths of alternate configuration files or null.
      See Also:
    • getConfigURLs

      public URL[] getConfigURLs(org.apache.commons.vfs2.FileSystemOptions opts)
      Gets URLs of alternate configurations.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      list of alternate configuration URLs or null.
      See Also:
    • setConfigConfiguration

      public void setConfigConfiguration(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.hadoop.conf.Configuration configuration)
      Sets the configuration object to be loaded after the defaults.

      Specifies an already initialized configuration object to override any specific HDFS settings. The property will be passed on to org.apache.hadoop.conf.Configuration#addResource(Configuration) after the URL was set as the default name with: Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url).

      One use for this is to set a different value for the dfs.client.use.datanode.hostname property in order to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses too.

      Parameters:
      opts - The FileSystemOptions to modify.
      configuration - additional configuration object or null to unset any configuration object previously set.
    • setConfigInputStream

      public void setConfigInputStream(org.apache.commons.vfs2.FileSystemOptions opts, InputStream inputStream)
      Sets the input stream of configuration file to be loaded after the defaults.

      Specifies an input stream connected to a config file to override any specific HDFS settings. The property will be passed on to org.apache.hadoop.conf.Configuration#addResource(InputStream) after the URL was set as the default name with: Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url).

      One use for this is to set a different value for the dfs.client.use.datanode.hostname property in order to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses too.

      Parameters:
      opts - The FileSystemOptions to modify.
      inputStream - input stream of additional configuration file or null to unset the configuration input stream previously set up.
    • setConfigName

      public void setConfigName(org.apache.commons.vfs2.FileSystemOptions opts, String name)
      Sets the name of configuration resource to be loaded after the defaults.

      Specifies the name of a config resource to override any specific HDFS settings. The property will be passed on to org.apache.hadoop.conf.Configuration#addResource(String) after the URL was set as the default name with: Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url).

      One use for this is to set a different value for the dfs.client.use.datanode.hostname property in order to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses too.

      This method may be called multiple times and all the specified resources will be loaded in the order they were specified.

      Note also, that if a list of names is provided, separated by commas (","), that this will work the same as calling this method a number of times with just one name each.

      Parameters:
      opts - The FileSystemOptions to modify.
      name - resource name of additional configuration or null to unset all the values set so far.
      See Also:
    • setConfigPath

      public void setConfigPath(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.hadoop.fs.Path path)
      Sets the full path of configuration file to be loaded after the defaults.

      Specifies the path of a local file system config file to override any specific HDFS settings. The property will be passed on to org.apache.hadoop.conf.Configuration#addResource(Path) after the URL was set as the default name with: Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url).

      One use for this is to set a different value for the dfs.client.use.datanode.hostname property in order to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses too.

      This method may be called multiple times and all the specified resources will be loaded in the order they were specified.

      Parameters:
      opts - The FileSystemOptions to modify.
      path - full path of additional configuration file (local file system) or null to unset all the path values set so far.
    • setConfigURL

      public void setConfigURL(org.apache.commons.vfs2.FileSystemOptions opts, URL url)
      Sets the URL of configuration file to be loaded after the defaults.

      Specifies the URL of a config file to override any specific HDFS settings. The property will be passed on to org.apache.hadoop.conf.Configuration#addResource(URL) after the URL was set as the default name with: Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url).

      One use for this is to set a different value for the dfs.client.use.datanode.hostname property in order to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses too.

      This method may be called multiple times and all the specified resources will be loaded in the order they were specified.

      Parameters:
      opts - The FileSystemOptions to modify.
      url - URL of additional configuration file or null to unset all the URL values set so far.