Class HdfsFileSystemConfigBuilder

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

Configuration settings for the HdfsFileSystem.
Since:
2.1
  • Method Details

    • getInstance

      Gets the singleton instance.
      Returns:
      HdfsFileSystemConfigBuilder instance
    • getConfigClass

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

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

      Gets the alternate configuration input stream.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      alternate configuration input stream or null.
      See Also:
    • getConfigNames

      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(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

      Gets URLs of alternate configurations.
      Parameters:
      opts - The FileSystemOptions.
      Returns:
      list of alternate configuration URLs or null.
      See Also:
    • setConfigConfiguration

      public void setConfigConfiguration(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(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(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(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(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.