public class BasicHadoopFileSystemFactory extends Object implements HadoopFileSystemFactory, Externalizable
FileSystem.get()
on each call.
If "fs.[prefix].impl.disable.cache"
is set to true
, file system instances will be cached by Hadoop.
Constructor and Description |
---|
BasicHadoopFileSystemFactory()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
get(String name)
Gets file system for the given user name.
|
@Nullable String[] |
getConfigPaths()
Gets paths to additional file system configuration files (e.g. core-site.xml).
|
@Nullable String |
getUri()
Gets file system URI.
|
@Nullable UserNameMapper |
getUserNameMapper()
Get optional user name mapper.
|
void |
readExternal(ObjectInput in) |
void |
setConfigPaths(String... cfgPaths)
Set paths to additional file system configuration files (e.g. core-site.xml).
|
void |
setUri(@Nullable String uri)
Sets file system URI.
|
void |
setUserNameMapper(@Nullable UserNameMapper usrNameMapper)
Set optional user name mapper.
|
void |
writeExternal(ObjectOutput out) |
public final Object get(String name) throws IOException
get
in interface HadoopFileSystemFactory
name
- User nameIOException
- In case of error.@Nullable public @Nullable String getUri()
This URI will be used as a first argument when calling FileSystem.get(URI, Configuration, String)
.
If not set, default URI will be picked from file system configuration using
FileSystem.getDefaultUri(Configuration)
method.
public void setUri(@Nullable @Nullable String uri)
getUri()
for more information.uri
- File system URI.@Nullable public @Nullable String[] getConfigPaths()
Path could be either absolute or relative to IGNITE_HOME
environment variable.
All provided paths will be loaded in the order they provided and then applied to Configuration
. It means
that path order might be important in some cases.
public void setConfigPaths(@Nullable String... cfgPaths)
getConfigPaths()
for
more information.cfgPaths
- Paths to file system configuration files.@Nullable public @Nullable UserNameMapper getUserNameMapper()
When IGFS is invoked from Hadoop, user name is passed along the way to ensure that request will be performed with proper user context. User name is passed in a simple form and doesn't contain any extended information, such as host, domain or Kerberos realm. You may use name mapper to translate plain user name to full user name required by security engine of the underlying file system.
For example you may want to use KerberosUserNameMapper
to user name from "johndoe"
to
"johndoe@YOUR.REALM.COM"
.
public void setUserNameMapper(@Nullable @Nullable UserNameMapper usrNameMapper)
getUserNameMapper()
for more information.usrNameMapper
- User name mapper.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019