Package org.apache.hadoop.fs.http.client
Class HttpFSFileSystem
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.http.client.HttpFSFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.conf.Configurable,org.apache.hadoop.fs.BulkDeleteSource,org.apache.hadoop.fs.DelegationTokenRenewer.Renewable,org.apache.hadoop.fs.PathCapabilities,org.apache.hadoop.security.token.DelegationTokenIssuer
- Direct Known Subclasses:
HttpsFSFileSystem
@Private
public class HttpFSFileSystem
extends org.apache.hadoop.fs.FileSystem
implements org.apache.hadoop.fs.DelegationTokenRenewer.Renewable
HttpFSServer implementation of the FileSystemAccess FileSystem.
This implementation allows a user to access HDFS over HTTP via a HttpFSServer server.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumNested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.FileSystem.DirectoryEntries, org.apache.hadoop.fs.FileSystem.DirListingIterator<T extends org.apache.hadoop.fs.FileStatus>, org.apache.hadoop.fs.FileSystem.Statistics -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Shortstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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 TypeMethodDescriptionvoidaccess(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsAction mode) voidallowSnapshot(org.apache.hadoop.fs.Path path) org.apache.hadoop.fs.FSDataOutputStreamappend(org.apache.hadoop.fs.Path f, int bufferSize, org.apache.hadoop.util.Progressable progress) Append to an existing file (optional operation).voidcancelDelegationToken(org.apache.hadoop.security.token.Token<?> token) voidconcat(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.Path[] psrcs) Concat existing files together.org.apache.hadoop.fs.FSDataOutputStreamcreate(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) Opens an FSDataOutputStream at the indicated Path with write-progress reporting.final org.apache.hadoop.fs.PathcreateSnapshot(org.apache.hadoop.fs.Path path, String snapshotName) booleandelete(org.apache.hadoop.fs.Path f) Deprecated.Use delete(Path, boolean) insteadbooleandelete(org.apache.hadoop.fs.Path f, boolean recursive) Delete a file.voiddeleteSnapshot(org.apache.hadoop.fs.Path path, String snapshotName) voiddisallowSnapshot(org.apache.hadoop.fs.Path path) org.apache.hadoop.fs.permission.AclStatusgetAclStatus(org.apache.hadoop.fs.Path path) Get the ACL information for a given fileCollection<org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo>Collection<org.apache.hadoop.hdfs.protocol.BlockStoragePolicy>org.apache.hadoop.fs.ContentSummarygetContentSummary(org.apache.hadoop.fs.Path f) protected intGet the default port for this file system.org.apache.hadoop.security.token.Token<?>getDelegationToken(String renewer) org.apache.hadoop.hdfs.protocol.ErasureCodingPolicygetErasureCodingPolicy(org.apache.hadoop.fs.Path path) org.apache.hadoop.fs.BlockLocation[]getFileBlockLocations(org.apache.hadoop.fs.FileStatus status, long offset, long length) org.apache.hadoop.fs.BlockLocation[]getFileBlockLocations(org.apache.hadoop.fs.Path path, long start, long len) org.apache.hadoop.fs.FileChecksumgetFileChecksum(org.apache.hadoop.fs.Path f) org.apache.hadoop.fs.FileStatusgetFileLinkStatus(org.apache.hadoop.fs.Path path) org.apache.hadoop.fs.FileStatusgetFileStatus(org.apache.hadoop.fs.Path f) Return a file status object that represents the path.org.apache.hadoop.fs.PathReturn the current user's home directory in this filesystem.org.apache.hadoop.fs.QuotaUsagegetQuotaUsage(org.apache.hadoop.fs.Path f) org.apache.hadoop.security.token.Token<?>org.apache.hadoop.fs.FsServerDefaultsorg.apache.hadoop.fs.FsServerDefaultsgetServerDefaults(org.apache.hadoop.fs.Path p) org.apache.hadoop.hdfs.protocol.SnapshotDiffReportgetSnapshotDiffReport(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName) org.apache.hadoop.hdfs.protocol.SnapshotDiffReportListinggetSnapshotDiffReportListing(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName, byte[] snapshotDiffStartPath, Integer snapshotDiffIndex) org.apache.hadoop.hdfs.protocol.SnapshotStatus[]getSnapshotListing(org.apache.hadoop.fs.Path snapshotRoot) org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus[]org.apache.hadoop.fs.FsStatusgetStatus(org.apache.hadoop.fs.Path path) org.apache.hadoop.hdfs.protocol.BlockStoragePolicygetStoragePolicy(org.apache.hadoop.fs.Path src) org.apache.hadoop.fs.PathgetTrashRoot(org.apache.hadoop.fs.Path fullPath) Get the root directory of Trash for a path in HDFS. 1.Collection<org.apache.hadoop.fs.FileStatus>getTrashRoots(boolean allUsers) getUri()Returns a URI whose scheme and authority identify this FileSystem.org.apache.hadoop.fs.PathGet the current working directory for the given file systembyte[]getXAttrs(org.apache.hadoop.fs.Path f) booleanhasPathCapability(org.apache.hadoop.fs.Path path, String capability) This filesystem's capabilities must be in sync with that ofDistributedFileSystem.hasPathCapability()except where the feature is not exposed (e.g. symlinks).voidinitialize(URI name, org.apache.hadoop.conf.Configuration conf) Called after a new FileSystem instance is constructed.org.apache.hadoop.fs.FileStatus[]listStatus(org.apache.hadoop.fs.Path f) GetFileStatusof files/directories in the given path.org.apache.hadoop.fs.FileSystem.DirectoryEntrieslistStatusBatch(org.apache.hadoop.fs.Path f, byte[] token) GetFileSystem.DirectoryEntriesof the given path.listXAttrs(org.apache.hadoop.fs.Path f) booleanmkdirs(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission) Make the given file and all non-existent parents into directories.voidmodifyAclEntries(org.apache.hadoop.fs.Path path, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) Modify the ACL entries for a file.org.apache.hadoop.fs.FSDataInputStreamopen(org.apache.hadoop.fs.Path f, int bufferSize) Opens an FSDataInputStream at the indicated Path.static StringpermissionToString(org.apache.hadoop.fs.permission.FsPermission p) Converts aFsPermissionto a Unix octal representation.voidremoveAcl(org.apache.hadoop.fs.Path path) Remove all ACLs from a filevoidremoveAclEntries(org.apache.hadoop.fs.Path path, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) Remove the specified ACL entries from a filevoidremoveDefaultAcl(org.apache.hadoop.fs.Path path) Removes the default ACL for the given filevoidremoveXAttr(org.apache.hadoop.fs.Path f, String name) booleanrename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) Renames Path src to Path dst.voidrenameSnapshot(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName) longrenewDelegationToken(org.apache.hadoop.security.token.Token<?> token) voidsatisfyStoragePolicy(org.apache.hadoop.fs.Path path) voidSet the ACLs for the given file<T extends org.apache.hadoop.security.token.TokenIdentifier>
voidsetDelegationToken(org.apache.hadoop.security.token.Token<T> token) voidsetErasureCodingPolicy(org.apache.hadoop.fs.Path path, String policyName) voidSet owner of a path (i.e. a file or a directory).voidsetPermission(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission) Set permission of a path.booleansetReplication(org.apache.hadoop.fs.Path src, short replication) Set replication for an existing file.voidsetStoragePolicy(org.apache.hadoop.fs.Path src, String policyName) voidsetTimes(org.apache.hadoop.fs.Path p, long mtime, long atime) Set access time of a filevoidsetWorkingDirectory(org.apache.hadoop.fs.Path newDir) Set the current working directory for the given file system.voidsetXAttr(org.apache.hadoop.fs.Path f, String name, byte[] value, EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag) booleantruncate(org.apache.hadoop.fs.Path f, long newLength) Truncate a file.voidunsetErasureCodingPolicy(org.apache.hadoop.fs.Path path) voidunsetStoragePolicy(org.apache.hadoop.fs.Path src) Methods inherited from class org.apache.hadoop.fs.FileSystem
append, append, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, 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, createSymlink, deleteOnExit, enableSymlinks, exists, fixRelativePart, get, get, get, getAdditionalTokenIssuers, getAllStatistics, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getDefaultBlockSize, getDefaultBlockSize, getDefaultReplication, getDefaultReplication, getDefaultUri, getEnclosingRoot, getFileChecksum, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getPathHandle, getReplication, getStatistics, getStatistics, getStatus, getStorageStatistics, getUsed, getUsed, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusIterator, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, open, open, openFile, openFile, openFileWithOptions, openFileWithOptions, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, resolveLink, resolvePath, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType, setVerifyChecksum, setWriteChecksum, setXAttr, startLocalOutput, supportsSymlinksMethods 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
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_VERSION
- See Also:
-
SCHEME
- See Also:
-
OP_PARAM
- See Also:
-
DO_AS_PARAM
- See Also:
-
OVERWRITE_PARAM
- See Also:
-
REPLICATION_PARAM
- See Also:
-
BLOCKSIZE_PARAM
- See Also:
-
PERMISSION_PARAM
- See Also:
-
UNMASKED_PERMISSION_PARAM
- See Also:
-
ACLSPEC_PARAM
- See Also:
-
DESTINATION_PARAM
- See Also:
-
RECURSIVE_PARAM
- See Also:
-
SOURCES_PARAM
- See Also:
-
OWNER_PARAM
- See Also:
-
GROUP_PARAM
- See Also:
-
MODIFICATION_TIME_PARAM
- See Also:
-
ACCESS_TIME_PARAM
- See Also:
-
XATTR_NAME_PARAM
- See Also:
-
XATTR_VALUE_PARAM
- See Also:
-
XATTR_SET_FLAG_PARAM
- See Also:
-
XATTR_ENCODING_PARAM
- See Also:
-
NEW_LENGTH_PARAM
- See Also:
-
START_AFTER_PARAM
- See Also:
-
POLICY_NAME_PARAM
- See Also:
-
SNAPSHOT_NAME_PARAM
- See Also:
-
OLD_SNAPSHOT_NAME_PARAM
- See Also:
-
SNAPSHOT_DIFF_START_PATH
- See Also:
-
SNAPSHOT_DIFF_INDEX
- See Also:
-
FSACTION_MODE_PARAM
- See Also:
-
EC_POLICY_NAME_PARAM
- See Also:
-
OFFSET_PARAM
- See Also:
-
LENGTH_PARAM
- See Also:
-
ALLUSERS_PARAM
- See Also:
-
DEFAULT_PERMISSION
-
ACLSPEC_DEFAULT
- See Also:
-
RENAME_JSON
- See Also:
-
TRUNCATE_JSON
- See Also:
-
DELETE_JSON
- See Also:
-
MKDIRS_JSON
- See Also:
-
HOME_DIR_JSON
- See Also:
-
TRASH_DIR_JSON
- See Also:
-
SET_REPLICATION_JSON
- See Also:
-
UPLOAD_CONTENT_TYPE
- See Also:
-
SNAPSHOT_JSON
- See Also:
-
FILE_STATUSES_JSON
- See Also:
-
FILE_STATUS_JSON
- See Also:
-
FS_STATUS_JSON
- See Also:
-
PATH_SUFFIX_JSON
- See Also:
-
TYPE_JSON
- See Also:
-
LENGTH_JSON
- See Also:
-
OWNER_JSON
- See Also:
-
GROUP_JSON
- See Also:
-
PERMISSION_JSON
- See Also:
-
ACCESS_TIME_JSON
- See Also:
-
MODIFICATION_TIME_JSON
- See Also:
-
BLOCK_SIZE_JSON
- See Also:
-
CHILDREN_NUM_JSON
- See Also:
-
FILE_ID_JSON
- See Also:
-
REPLICATION_JSON
- See Also:
-
STORAGEPOLICY_JSON
- See Also:
-
ECPOLICYNAME_JSON
- See Also:
-
XATTRS_JSON
- See Also:
-
XATTR_NAME_JSON
- See Also:
-
XATTR_VALUE_JSON
- See Also:
-
XATTRNAMES_JSON
- See Also:
-
ECPOLICY_JSON
- See Also:
-
SYMLINK_JSON
- See Also:
-
CAPACITY_JSON
- See Also:
-
USED_JSON
- See Also:
-
REMAINING_JSON
- See Also:
-
FILE_CHECKSUM_JSON
- See Also:
-
CHECKSUM_ALGORITHM_JSON
- See Also:
-
CHECKSUM_BYTES_JSON
- See Also:
-
CHECKSUM_LENGTH_JSON
- See Also:
-
CONTENT_SUMMARY_JSON
- See Also:
-
CONTENT_SUMMARY_DIRECTORY_COUNT_JSON
- See Also:
-
CONTENT_SUMMARY_ECPOLICY_JSON
- See Also:
-
CONTENT_SUMMARY_FILE_COUNT_JSON
- See Also:
-
CONTENT_SUMMARY_LENGTH_JSON
- See Also:
-
QUOTA_USAGE_JSON
- See Also:
-
QUOTA_USAGE_FILE_AND_DIRECTORY_COUNT_JSON
- See Also:
-
QUOTA_USAGE_QUOTA_JSON
- See Also:
-
QUOTA_USAGE_SPACE_CONSUMED_JSON
- See Also:
-
QUOTA_USAGE_SPACE_QUOTA_JSON
- See Also:
-
QUOTA_USAGE_CONSUMED_JSON
- See Also:
-
QUOTA_USAGE_TYPE_QUOTA_JSON
- See Also:
-
ACL_STATUS_JSON
- See Also:
-
ACL_STICKY_BIT_JSON
- See Also:
-
ACL_ENTRIES_JSON
- See Also:
-
ACL_BIT_JSON
- See Also:
-
ENC_BIT_JSON
- See Also:
-
EC_BIT_JSON
- See Also:
-
SNAPSHOT_BIT_JSON
- See Also:
-
DIRECTORY_LISTING_JSON
- See Also:
-
PARTIAL_LISTING_JSON
- See Also:
-
REMAINING_ENTRIES_JSON
- See Also:
-
STORAGE_POLICIES_JSON
- See Also:
-
STORAGE_POLICY_JSON
- See Also:
-
BLOCK_LOCATIONS_JSON
- See Also:
-
HTTP_TEMPORARY_REDIRECT
public static final int HTTP_TEMPORARY_REDIRECT- See Also:
-
-
Constructor Details
-
HttpFSFileSystem
public HttpFSFileSystem()
-
-
Method Details
-
initialize
Called after a new FileSystem instance is constructed.- Overrides:
initializein classorg.apache.hadoop.fs.FileSystem- Parameters:
name- a uri whose authority section names the host, port, etc. for this FileSystemconf- the configuration- Throws:
IOException
-
getScheme
- Overrides:
getSchemein classorg.apache.hadoop.fs.FileSystem
-
getUri
Returns a URI whose scheme and authority identify this FileSystem.- Specified by:
getUriin classorg.apache.hadoop.fs.FileSystem- Returns:
- the URI whose scheme and authority identify this FileSystem.
-
getDefaultPort
protected int getDefaultPort()Get the default port for this file system.- Overrides:
getDefaultPortin classorg.apache.hadoop.fs.FileSystem- Returns:
- the default port or 0 if there isn't one
-
open
public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f, int bufferSize) throws IOException Opens an FSDataInputStream at the indicated Path.IMPORTANT: the returned
FSDataInputStreamdoes not support thePositionReadableandSeekablemethods.- Specified by:
openin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the file name to openbufferSize- the size of the buffer to be used.- Throws:
IOException
-
permissionToString
Converts aFsPermissionto a Unix octal representation.- Parameters:
p- the permission.- Returns:
- the Unix string symbolic reprentation.
-
create
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress) throws IOException Opens an FSDataOutputStream at the indicated Path with write-progress reporting.IMPORTANT: The
Progressableparameter is not used.- Specified by:
createin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the file name to open.permission- file permission.overwrite- if a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown.bufferSize- the size of the buffer to be used.replication- required block replication for the file.blockSize- block size.progress- progressable.- Throws:
IOException- See Also:
-
append
public org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f, int bufferSize, org.apache.hadoop.util.Progressable progress) throws IOException Append to an existing file (optional operation).IMPORTANT: The
Progressableparameter is not used.- Specified by:
appendin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the existing file to be appended.bufferSize- the size of the buffer to be used.progress- for reporting progress if it is not null.- Throws:
IOException
-
truncate
Truncate a file.- Overrides:
truncatein classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the file to be truncated.newLength- The size the file is to be truncated to.- Throws:
IOException
-
concat
public void concat(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.Path[] psrcs) throws IOException Concat existing files together.- Overrides:
concatin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the path to the target destination.psrcs- the paths to the sources to use for the concatenation.- Throws:
IOException
-
rename
public boolean rename(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException Renames Path src to Path dst. Can take place on local fs or remote DFS.- Specified by:
renamein classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
delete
Deprecated.Use delete(Path, boolean) insteadDelete a file.- Overrides:
deletein classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
delete
Delete a file.- Specified by:
deletein classorg.apache.hadoop.fs.FileSystem- Parameters:
f- the path to delete.recursive- 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
-
listStatus
GetFileStatusof files/directories in the given path. If path corresponds to a file thenFileStatusof that file is returned. Else if path represents a directory thenFileStatusof all files/directories inside given path is returned.- Specified by:
listStatusin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- given path- Returns:
- the statuses of the files/directories in the given path
- Throws:
IOException
-
listStatusBatch
public org.apache.hadoop.fs.FileSystem.DirectoryEntries listStatusBatch(org.apache.hadoop.fs.Path f, byte[] token) throws FileNotFoundException, IOException GetFileSystem.DirectoryEntriesof the given path.FileSystem.DirectoryEntriescontains an array ofFileStatus, as well as iteration information.- Overrides:
listStatusBatchin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- given path- Returns:
FileSystem.DirectoryEntriesfor given path- Throws:
FileNotFoundExceptionIOException
-
setWorkingDirectory
public void setWorkingDirectory(org.apache.hadoop.fs.Path newDir) Set the current working directory for the given file system. All relative paths will be resolved relative to it.- Specified by:
setWorkingDirectoryin classorg.apache.hadoop.fs.FileSystem- Parameters:
newDir- new directory.
-
getWorkingDirectory
public org.apache.hadoop.fs.Path getWorkingDirectory()Get the current working directory for the given file system- Specified by:
getWorkingDirectoryin classorg.apache.hadoop.fs.FileSystem- Returns:
- the directory pathname
-
mkdirs
public boolean mkdirs(org.apache.hadoop.fs.Path f, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException Make the given file and all non-existent parents into directories. Has the semantics of Unix 'mkdir -p'. Existence of the directory hierarchy is not an error.- Specified by:
mkdirsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getFileStatus
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f) throws IOException Return a file status object that represents the path.- Specified by:
getFileStatusin classorg.apache.hadoop.fs.FileSystem- Parameters:
f- The path we want information from- Returns:
- a FileStatus object
- Throws:
FileNotFoundException- when the path does not exist; IOException see specific implementationIOException
-
getHomeDirectory
public org.apache.hadoop.fs.Path getHomeDirectory()Return the current user's home directory in this filesystem. The default implementation returns "/user/$USER/".- Overrides:
getHomeDirectoryin classorg.apache.hadoop.fs.FileSystem
-
getTrashRoot
public org.apache.hadoop.fs.Path getTrashRoot(org.apache.hadoop.fs.Path fullPath) Get the root directory of Trash for a path in HDFS. 1. File in encryption zone returns /ez1/.Trash/username. 2. File not in encryption zone, or encountered exception when checking the encryption zone of the path, returns /users/username/.Trash. Caller appends either Current or checkpoint timestamp for trash destination. The default implementation returns "/user/username/.Trash".- Overrides:
getTrashRootin classorg.apache.hadoop.fs.FileSystem- Parameters:
fullPath- the trash root of the path to be determined.- Returns:
- trash root
-
setOwner
public void setOwner(org.apache.hadoop.fs.Path p, String username, String groupname) throws IOException Set owner of a path (i.e. a file or a directory). The parameters username and groupname cannot both be null.- Overrides:
setOwnerin classorg.apache.hadoop.fs.FileSystem- Parameters:
p- The pathusername- If it is null, the original username remains unchanged.groupname- If it is null, the original groupname remains unchanged.- Throws:
IOException
-
setPermission
public void setPermission(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException Set permission of a path.- Overrides:
setPermissionin classorg.apache.hadoop.fs.FileSystem- Parameters:
p- path.permission- permission.- Throws:
IOException
-
setTimes
Set access time of a file- Overrides:
setTimesin classorg.apache.hadoop.fs.FileSystem- Parameters:
p- The pathmtime- Set the modification time of this file. The number of milliseconds since Jan 1, 1970. A value of -1 means that this call should not set modification time.atime- Set the access time of this file. The number of milliseconds since Jan 1, 1970. A value of -1 means that this call should not set access time.- Throws:
IOException
-
setReplication
Set replication for an existing file.- Overrides:
setReplicationin classorg.apache.hadoop.fs.FileSystem- Parameters:
src- file namereplication- new replication- Returns:
- true if successful; false if file does not exist or is a directory
- Throws:
IOException
-
modifyAclEntries
public void modifyAclEntries(org.apache.hadoop.fs.Path path, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException Modify the ACL entries for a file.- Overrides:
modifyAclEntriesin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path to modifyaclSpec- describing modifications- Throws:
IOException
-
removeAclEntries
public void removeAclEntries(org.apache.hadoop.fs.Path path, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException Remove the specified ACL entries from a file- Overrides:
removeAclEntriesin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path to modifyaclSpec- describing entries to remove- Throws:
IOException
-
removeDefaultAcl
Removes the default ACL for the given file- Overrides:
removeDefaultAclin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path from which to remove the default ACL.- Throws:
IOException
-
removeAcl
Remove all ACLs from a file- Overrides:
removeAclin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path from which to remove all ACLs- Throws:
IOException
-
setAcl
public void setAcl(org.apache.hadoop.fs.Path path, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException Set the ACLs for the given file- Overrides:
setAclin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path to modifyaclSpec- describing modifications, must include entries for user, group, and others for compatibility with permission bits.- Throws:
IOException
-
getAclStatus
public org.apache.hadoop.fs.permission.AclStatus getAclStatus(org.apache.hadoop.fs.Path path) throws IOException Get the ACL information for a given file- Overrides:
getAclStatusin classorg.apache.hadoop.fs.FileSystem- Parameters:
path- Path to acquire ACL info for- Returns:
- the ACL information in JSON format
- Throws:
IOException
-
getContentSummary
public org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f) throws IOException - Overrides:
getContentSummaryin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getQuotaUsage
public org.apache.hadoop.fs.QuotaUsage getQuotaUsage(org.apache.hadoop.fs.Path f) throws IOException - Overrides:
getQuotaUsagein classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getFileChecksum
public org.apache.hadoop.fs.FileChecksum getFileChecksum(org.apache.hadoop.fs.Path f) throws IOException - Overrides:
getFileChecksumin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getDelegationToken
public org.apache.hadoop.security.token.Token<?> getDelegationToken(String renewer) throws IOException - Specified by:
getDelegationTokenin interfaceorg.apache.hadoop.security.token.DelegationTokenIssuer- Overrides:
getDelegationTokenin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
renewDelegationToken
public long renewDelegationToken(org.apache.hadoop.security.token.Token<?> token) throws IOException - Throws:
IOException
-
cancelDelegationToken
public void cancelDelegationToken(org.apache.hadoop.security.token.Token<?> token) throws IOException - Throws:
IOException
-
getRenewToken
public org.apache.hadoop.security.token.Token<?> getRenewToken()- Specified by:
getRenewTokenin interfaceorg.apache.hadoop.fs.DelegationTokenRenewer.Renewable
-
setDelegationToken
public <T extends org.apache.hadoop.security.token.TokenIdentifier> void setDelegationToken(org.apache.hadoop.security.token.Token<T> token) - Specified by:
setDelegationTokenin interfaceorg.apache.hadoop.fs.DelegationTokenRenewer.Renewable
-
setXAttr
public void setXAttr(org.apache.hadoop.fs.Path f, String name, byte[] value, EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag) throws IOException - Overrides:
setXAttrin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getXAttr
- Overrides:
getXAttrin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getXAttrs
- Overrides:
getXAttrsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getXAttrs
public Map<String,byte[]> getXAttrs(org.apache.hadoop.fs.Path f, List<String> names) throws IOException - Overrides:
getXAttrsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
listXAttrs
- Overrides:
listXAttrsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
removeXAttr
- Overrides:
removeXAttrin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getAllStoragePolicies
public Collection<org.apache.hadoop.hdfs.protocol.BlockStoragePolicy> getAllStoragePolicies() throws IOException- Overrides:
getAllStoragePoliciesin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getStoragePolicy
public org.apache.hadoop.hdfs.protocol.BlockStoragePolicy getStoragePolicy(org.apache.hadoop.fs.Path src) throws IOException - Overrides:
getStoragePolicyin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
setStoragePolicy
- Overrides:
setStoragePolicyin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
unsetStoragePolicy
- Overrides:
unsetStoragePolicyin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
allowSnapshot
- Throws:
IOException
-
disallowSnapshot
- Throws:
IOException
-
createSnapshot
public final org.apache.hadoop.fs.Path createSnapshot(org.apache.hadoop.fs.Path path, String snapshotName) throws IOException - Overrides:
createSnapshotin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
renameSnapshot
public void renameSnapshot(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName) throws IOException - Overrides:
renameSnapshotin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
deleteSnapshot
- Overrides:
deleteSnapshotin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getSnapshotDiffReport
public org.apache.hadoop.hdfs.protocol.SnapshotDiffReport getSnapshotDiffReport(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName) throws IOException - Throws:
IOException
-
getSnapshotDiffReportListing
public org.apache.hadoop.hdfs.protocol.SnapshotDiffReportListing getSnapshotDiffReportListing(org.apache.hadoop.fs.Path path, String snapshotOldName, String snapshotNewName, byte[] snapshotDiffStartPath, Integer snapshotDiffIndex) throws IOException - Throws:
IOException
-
getSnapshottableDirectoryList
public org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus[] getSnapshottableDirectoryList() throws IOException- Throws:
IOException
-
getSnapshotListing
public org.apache.hadoop.hdfs.protocol.SnapshotStatus[] getSnapshotListing(org.apache.hadoop.fs.Path snapshotRoot) throws IOException - Throws:
IOException
-
hasPathCapability
public boolean hasPathCapability(org.apache.hadoop.fs.Path path, String capability) throws IOException This filesystem's capabilities must be in sync with that ofDistributedFileSystem.hasPathCapability()except where the feature is not exposed (e.g. symlinks).- Specified by:
hasPathCapabilityin interfaceorg.apache.hadoop.fs.PathCapabilities- Overrides:
hasPathCapabilityin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getServerDefaults
- Overrides:
getServerDefaultsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getServerDefaults
public org.apache.hadoop.fs.FsServerDefaults getServerDefaults(org.apache.hadoop.fs.Path p) throws IOException - Overrides:
getServerDefaultsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
access
public void access(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsAction mode) throws IOException - Overrides:
accessin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
setErasureCodingPolicy
public void setErasureCodingPolicy(org.apache.hadoop.fs.Path path, String policyName) throws IOException - Throws:
IOException
-
getErasureCodingPolicy
public org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy getErasureCodingPolicy(org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
unsetErasureCodingPolicy
- Throws:
IOException
-
satisfyStoragePolicy
- Overrides:
satisfyStoragePolicyin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getFileBlockLocations
public org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.Path path, long start, long len) throws IOException - Overrides:
getFileBlockLocationsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getFileBlockLocations
public org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.FileStatus status, long offset, long length) throws IOException - Overrides:
getFileBlockLocationsin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getFileLinkStatus
public org.apache.hadoop.fs.FileStatus getFileLinkStatus(org.apache.hadoop.fs.Path path) throws IOException - Overrides:
getFileLinkStatusin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getStatus
- Overrides:
getStatusin classorg.apache.hadoop.fs.FileSystem- Throws:
IOException
-
getAllErasureCodingPolicies
public Collection<org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo> getAllErasureCodingPolicies() throws IOException- Throws:
IOException
-
getAllErasureCodingCodecs
- Throws:
IOException
-
getTrashRoots
- Overrides:
getTrashRootsin classorg.apache.hadoop.fs.FileSystem
-