Class HdfsFileSystemConfigBuilder
- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.String[]
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.static HdfsFileSystemConfigBuilder
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
-
Method Details
-
getInstance
Gets the singleton instance.- Returns:
- HdfsFileSystemConfigBuilder instance
-
getConfigClass
- Specified by:
getConfigClass
in classorg.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
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
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(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 ornull
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 ornull
to unset the configuration input stream previously set up.
-
setConfigName
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 ornull
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) ornull
to unset all the path values set so far.
-
setConfigURL
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 ornull
to unset all the URL values set so far.
-