Package org.apache.hadoop.fs.http
Class HttpFileSystem
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.http.HttpFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,Configurable,BulkDeleteSource,PathCapabilities,DelegationTokenIssuer
A Filesystem that reads from HTTP endpoint.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem
FileSystem.DirectoryEntries, FileSystem.DirListingIterator<T extends FileStatus>, FileSystem.Statistics -
Field Summary
Fields inherited from class org.apache.hadoop.fs.FileSystem
DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIXFields inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer
TOKEN_LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(Path path, int i, Progressable progressable) Append to an existing file (optional operation).create(Path path, FsPermission fsPermission, boolean b, int i, short i1, long l, Progressable progressable) Create an FSDataOutputStream at the indicated Path with write-progress reporting.booleanDelete a file.getFileStatus(Path path) Return a file status object that represents the path.Return the protocol scheme for this FileSystem.getUri()Returns a URI which identifies this FileSystem.Get the current working directory for the given FileSystembooleanhasPathCapability(Path path, String capability) Declare that this filesystem connector is always read only.voidinitialize(URI name, Configuration conf) Initialize a FileSystem.listStatus(Path path) List the statuses of the files/directories in the given path if the path is a directory.booleanmkdirs(Path path, FsPermission fsPermission) Make the given file and all non-existent parents into directories.Opens an FSDataInputStream at the indicated Path.booleanRenames Path src to Path dst.voidsetWorkingDirectory(Path path) Set the current working directory for the given FileSystem.Methods inherited from class org.apache.hadoop.fs.FileSystem
access, append, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createBulkDelete, createDataInputStreamBuilder, createDataInputStreamBuilder, createDataOutputStreamBuilder, createFile, createMultipartUploader, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createPathHandle, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAdditionalTokenIssuers, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getDelegationToken, getEnclosingRoot, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setQuota, setQuotaByStorageType, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicyMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer
addDelegationTokens
-
Constructor Details
-
HttpFileSystem
public HttpFileSystem()
-
-
Method Details
-
getScheme
Description copied from class:FileSystemReturn the protocol scheme for this FileSystem.This implementation throws an
UnsupportedOperationException.- Returns:
- the protocol scheme for this FileSystem.
-
initialize
Description copied from class:FileSystemInitialize a FileSystem. Called after the new FileSystem instance is constructed, and before it is ready for use. FileSystem implementations overriding this method MUST forward it to their superclass, though the order in which it is done, and whether to alter the configuration before the invocation are options of the subclass.- Overrides:
initializein classFileSystem- Parameters:
name- a URI whose authority section names the host, port, etc. for this FileSystemconf- the configuration- Throws:
IOException- on any failure to initialize this instance.
-
getUri
Description copied from class:FileSystemReturns a URI which identifies this FileSystem.- Specified by:
getUriin classFileSystem- Returns:
- the URI of this filesystem.
-
open
Description copied from class:FileSystemOpens an FSDataInputStream at the indicated Path.- Specified by:
openin classFileSystem- Parameters:
path- the file name to openbufferSize- the size of the buffer to be used.- Returns:
- input stream.
- Throws:
IOException- IO failure
-
create
public FSDataOutputStream create(Path path, FsPermission fsPermission, boolean b, int i, short i1, long l, Progressable progressable) throws IOException Description copied from class:FileSystemCreate an FSDataOutputStream at the indicated Path with write-progress reporting.- Specified by:
createin classFileSystem- Parameters:
path- the file name to openfsPermission- file permissionb- if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.i- the size of the buffer to be used.i1- required block replication for the file.l- block sizeprogressable- the progress reporter- Returns:
- output stream.
- Throws:
IOException- IO failure- See Also:
-
append
Description copied from class:FileSystemAppend to an existing file (optional operation).- Specified by:
appendin classFileSystem- Parameters:
path- the existing file to be appended.i- the size of the buffer to be used.progressable- for reporting progress if it is not null.- Returns:
- output stream.
- Throws:
IOException- IO failure
-
rename
Description copied from class:FileSystemRenames Path src to Path dst.- Specified by:
renamein classFileSystem- Parameters:
path- path to be renamedpath1- new path after rename- Returns:
- true if rename is successful
- Throws:
IOException- on failure
-
delete
Description copied from class:FileSystemDelete a file.- Specified by:
deletein classFileSystem- Parameters:
path- the path to delete.b- if path is a directory and set to true, the directory is deleted else throws an exception. In case of a file the recursive can be set to either true or false.- Returns:
- true if delete is successful else false.
- Throws:
IOException- IO failure
-
listStatus
Description copied from class:FileSystemList the statuses of the files/directories in the given path if the path is a directory.Does not guarantee to return the List of files/directories status in a sorted order.
Will not return null. Expect IOException upon access error.
- Specified by:
listStatusin classFileSystem- Parameters:
path- given path- Returns:
- the statuses of the files/directories in the given patch
- Throws:
FileNotFoundException- when the path does not existIOException- see specific implementation
-
setWorkingDirectory
Description copied from class:FileSystemSet the current working directory for the given FileSystem. All relative paths will be resolved relative to it.- Specified by:
setWorkingDirectoryin classFileSystem- Parameters:
path- Path of new working directory
-
getWorkingDirectory
Description copied from class:FileSystemGet the current working directory for the given FileSystem- Specified by:
getWorkingDirectoryin classFileSystem- Returns:
- the directory pathname
-
mkdirs
Description copied from class:FileSystemMake the given file and all non-existent parents into directories. Has roughly the semantics of Unix @{code mkdir -p}. Existence of the directory hierarchy is not an error.- Specified by:
mkdirsin classFileSystem- Parameters:
path- path to createfsPermission- to apply to f- Returns:
- if mkdir success true, not false.
- Throws:
IOException- IO failure
-
getFileStatus
Description copied from class:FileSystemReturn a file status object that represents the path.- Specified by:
getFileStatusin classFileSystem- Parameters:
path- The path we want information from- Returns:
- a FileStatus object
- Throws:
FileNotFoundException- when the path does not existIOException- see specific implementation
-
hasPathCapability
Declare that this filesystem connector is always read only. The base FileSystem implementation generally has no knowledge of the capabilities of actual implementations. Unless it has a way to explicitly determine the capabilities, this method returns false. Probe for a specific capability under the given path. If the function returnstrue, this instance is explicitly declaring that the capability is available. If the function returnsfalse, it can mean one of:- The capability is not known.
- The capability is known but it is not supported.
- The capability is known but the filesystem does not know if it is supported under the supplied path.
Implementors:
PathCapabilitiesSupportcan be used to help implement this method.- Specified by:
hasPathCapabilityin interfacePathCapabilities- Overrides:
hasPathCapabilityin classFileSystem- Parameters:
path- path to query the capability of.capability- non-null, non-empty string to query the path for support.- Returns:
- true if the capability is supported under that part of the FS.
- Throws:
IOException- this should not be raised, except on problems resolving paths or relaying the call.
-