public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder
Modifier and Type | Method and Description |
---|---|
protected Class<? extends FileSystem> |
getConfigClass()
Get the target of this configuration.
|
org.apache.hadoop.conf.Configuration |
getConfigConfiguration(FileSystemOptions opts)
Get alternate configuration object.
|
InputStream |
getConfigInputStream(FileSystemOptions opts)
Get alternate configuration input stream.
|
String[] |
getConfigNames(FileSystemOptions opts)
Get names of alternate configuration resources.
|
org.apache.hadoop.fs.Path[] |
getConfigPaths(FileSystemOptions opts)
Get paths of alternate configuration file system files.
|
URL[] |
getConfigURLs(FileSystemOptions opts)
Get URLs of alternate configurations.
|
static HdfsFileSystemConfigBuilder |
getInstance() |
void |
setConfigConfiguration(FileSystemOptions opts,
org.apache.hadoop.conf.Configuration configuration)
Sets the configuration object to be loaded after the defaults.
|
void |
setConfigInputStream(FileSystemOptions opts,
InputStream inputStream)
Sets the input stream of configuration file to be loaded after the defaults.
|
void |
setConfigName(FileSystemOptions opts,
String name)
Sets the name of configuration resource to be loaded after the defaults.
|
void |
setConfigPath(FileSystemOptions opts,
org.apache.hadoop.fs.Path path)
Sets the full path of configuration file to be loaded after the defaults.
|
void |
setConfigURL(FileSystemOptions opts,
URL url)
Sets the URL of configuration file to be loaded after the defaults.
|
getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI
public static HdfsFileSystemConfigBuilder getInstance()
protected Class<? extends FileSystem> getConfigClass()
FileSystemConfigBuilder
getConfigClass
in class FileSystemConfigBuilder
public String[] getConfigNames(FileSystemOptions opts)
opts
- The FileSystemOptions.null
.setConfigName(FileSystemOptions, String)
public void setConfigName(FileSystemOptions opts, String name)
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.
opts
- The FileSystemOptions to modify.name
- resource name of additional configuration or null
to unset all the
values set so far.getConfigNames(org.apache.commons.vfs2.FileSystemOptions)
public org.apache.hadoop.fs.Path[] getConfigPaths(FileSystemOptions opts)
opts
- The FileSystemOptions.null
.setConfigPath(FileSystemOptions, Path)
public void setConfigPath(FileSystemOptions opts, org.apache.hadoop.fs.Path path)
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.
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.public URL[] getConfigURLs(FileSystemOptions opts)
opts
- The FileSystemOptions.null
.setConfigURL(FileSystemOptions, URL)
public void setConfigURL(FileSystemOptions opts, URL url)
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.
opts
- The FileSystemOptions to modify.url
- URL of additional configuration file or null
to unset all the URL
values set so far.public InputStream getConfigInputStream(FileSystemOptions opts)
opts
- The FileSystemOptions.null
.setConfigInputStream(FileSystemOptions, InputStream)
public void setConfigInputStream(FileSystemOptions opts, InputStream inputStream)
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.
opts
- The FileSystemOptions to modify.inputStream
- input stream of additional configuration file or null
to unset
the configuration input stream previously set up.public org.apache.hadoop.conf.Configuration getConfigConfiguration(FileSystemOptions opts)
opts
- The FileSystemOptions.null
.setConfigConfiguration(FileSystemOptions, Configuration)
public void setConfigConfiguration(FileSystemOptions opts, org.apache.hadoop.conf.Configuration configuration)
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.
opts
- The FileSystemOptions to modify.configuration
- additional configuration object or null
to unset any configuration
object previously set.Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.