public class BasicHadoopFileSystemFactory extends Object implements HadoopFileSystemFactory, Externalizable, LifecycleAware
FileSystem.get() on each call.
If "fs.[prefix].impl.disable.cache" is set to true, file system instances will be cached by Hadoop.
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
cfg
Configuration of the secondary filesystem, never null.
|
protected String[] |
cfgPaths
File system config paths.
|
protected URI |
fullUri
Resulting URI.
|
protected String |
uri
File system URI.
|
| Constructor and Description |
|---|
BasicHadoopFileSystemFactory()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected FileSystem |
create(String usrName)
Internal file system creation routine, invoked in correct class loader context.
|
FileSystem |
get(String usrName)
Gets file system for the given user name.
|
protected FileSystem |
get0(String usrName)
Internal file system create routine.
|
String[] |
getConfigPaths()
Gets paths to additional file system configuration files (e.g. core-site.xml).
|
String |
getUri()
Gets file system URI.
|
void |
readExternal(ObjectInput in) |
void |
setConfigPaths(String... cfgPaths)
Set paths to additional file system configuration files (e.g. core-site.xml).
|
void |
setUri(String uri)
Sets file system URI.
|
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
void |
writeExternal(ObjectOutput out) |
protected String uri
protected String[] cfgPaths
protected transient Configuration cfg
protected transient URI fullUri
public FileSystem get(String usrName) throws IOException
get in interface HadoopFileSystemFactoryusrName - User nameIOException - In case of error.protected FileSystem get0(String usrName) throws IOException
usrName - User name.IOException - If failed.protected FileSystem create(String usrName) throws IOException, InterruptedException
usrName - User name.IOException - If failed.InterruptedException - if the current thread is interrupted.@Nullable public 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
String uri)
getUri() for more information.uri - File system URI.@Nullable public 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.
NOTE! Factory can be serialized and transferred to other machines where instance of
IgniteHadoopFileSystem resides. Corresponding paths must exist on these machines as well.
public void setConfigPaths(@Nullable
String... cfgPaths)
getConfigPaths() for
more information.cfgPaths - Paths to file system configuration files.public void start()
throws IgniteException
start in interface LifecycleAwareIgniteException - If failed.public void stop()
throws IgniteException
stop in interface LifecycleAwareIgniteException - If failed.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016