To facilitate this, Hadoop supports a notion of a default file system. The user can set his default file system, although this is typically set up for you in your environment via your default config. A default file system implies a default scheme and authority; slash-relative names (such as /for/bar) are resolved relative to that default FS. Similarly a user can also have working-directory-relative names (i.e. names not starting with a slash). While the working directory is generally in the same default FS, the wd can be in a different FS.
Hence Hadoop path names can be one of:
****The Role of the FileContext and configuration defaults****
The FileContext provides file namespace context for resolving file names; it also contains the umask for permissions, In that sense it is like the per-process file-related state in Unix system. These two properties
The file system related SS defaults are
*** Usage Model for the FileContext class ***
Example 1: use the default config read from the $HADOOP_CONFIG/core.xml. Unspecified values come from core-defaults.xml in the release jar.
FileContext
provides an implementation of the Context
object that provides a direct mapping from a request URI as defined in RFC 2616 to an OS specific target. This uses a File
object to define the mapping for the request URI paths. Using a File
object allows the FileContext
to be easily used with both DOS and UNIX systems. This Indexer
implementation uses an MIME database to obtain mappings for the getContentType
method. The file used is acquired from the class path as a mapping from file extension to MIME type. This file can be modified if any additional types are required. However it is more advisable to simple extend this object and override the content type method.
@author Niall Gallagher
@see org.simpleframework.http.resource.FileIndexer
|
|
|
|
|
|
|
|