@InterfaceAudience.Private public class HttpFSFileSystem extends FileSystem implements DelegationTokenRenewer.Renewable
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpFSFileSystem.FILE_TYPE |
static class |
HttpFSFileSystem.Operation |
FileSystem.StatisticsDEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics| Constructor and Description |
|---|
HttpFSFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
Append to an existing file (optional operation).
|
void |
cancelDelegationToken(Token<?> token) |
void |
concat(Path f,
Path[] psrcs)
Concat existing files together.
|
FSDataOutputStream |
create(Path f,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
boolean |
delete(Path f)
Deprecated.
Use delete(Path, boolean) instead
|
boolean |
delete(Path f,
boolean recursive)
Delete a file.
|
ContentSummary |
getContentSummary(Path f)
Return the
ContentSummary of a given Path. |
protected int |
getDefaultPort()
Get the default port for this file system.
|
Token<?> |
getDelegationToken(String renewer)
Get a new delegation token for this file system.
|
FileChecksum |
getFileChecksum(Path f)
Get the checksum of a file.
|
FileStatus |
getFileStatus(Path f)
Return a file status object that represents the path.
|
Path |
getHomeDirectory()
Return the current user's home directory in this filesystem.
|
Token<?> |
getRenewToken() |
String |
getScheme()
Return the protocol scheme for the FileSystem.
|
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
Path |
getWorkingDirectory()
Get the current working directory for the given file system
|
void |
initialize(URI name,
Configuration conf)
Called after a new FileSystem instance is constructed.
|
FileStatus[] |
listStatus(Path f)
List the statuses of the files/directories in the given path if the path is
a directory.
|
boolean |
mkdirs(Path f,
FsPermission permission)
Make the given file and all non-existent parents into
directories.
|
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
static String |
permissionToString(FsPermission p)
Converts a
FsPermission to a Unix octal representation. |
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
long |
renewDelegationToken(Token<?> token) |
<T extends TokenIdentifier> |
setDelegationToken(Token<T> token)
Set delegation token.
|
void |
setOwner(Path p,
String username,
String groupname)
Set owner of a path (i.e.
|
void |
setPermission(Path p,
FsPermission permission)
Set permission of a path.
|
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file.
|
void |
setTimes(Path p,
long mtime,
long atime)
Set access time of a file
|
void |
setWorkingDirectory(Path newDir)
Set the current working directory for the given file system.
|
addDelegationTokens, append, append, 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, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createSnapshot, createSnapshot, createSymlink, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getDefaultBlockSize, getDefaultBlockSize, getDefaultReplication, getDefaultReplication, getDefaultUri, getFileBlockLocations, getFileBlockLocations, getFileLinkStatus, getFileSystemClass, getFSofPath, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getUsed, globStatus, globStatus, isDirectory, isFile, isSymlinksEnabled, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, renameSnapshot, resolveLink, resolvePath, setDefaultUri, setDefaultUri, setVerifyChecksum, setWriteChecksum, startLocalOutput, supportsSymlinksgetConf, setConfpublic static final String SERVICE_NAME
public static final String SERVICE_VERSION
public static final String SCHEME
public static final String OP_PARAM
public static final String DO_AS_PARAM
public static final String OVERWRITE_PARAM
public static final String REPLICATION_PARAM
public static final String BLOCKSIZE_PARAM
public static final String PERMISSION_PARAM
public static final String DESTINATION_PARAM
public static final String RECURSIVE_PARAM
public static final String SOURCES_PARAM
public static final String OWNER_PARAM
public static final String GROUP_PARAM
public static final String MODIFICATION_TIME_PARAM
public static final String ACCESS_TIME_PARAM
public static final Short DEFAULT_PERMISSION
public static final String RENAME_JSON
public static final String DELETE_JSON
public static final String MKDIRS_JSON
public static final String HOME_DIR_JSON
public static final String SET_REPLICATION_JSON
public static final String UPLOAD_CONTENT_TYPE
public static final String FILE_STATUSES_JSON
public static final String FILE_STATUS_JSON
public static final String PATH_SUFFIX_JSON
public static final String TYPE_JSON
public static final String LENGTH_JSON
public static final String OWNER_JSON
public static final String GROUP_JSON
public static final String PERMISSION_JSON
public static final String ACCESS_TIME_JSON
public static final String MODIFICATION_TIME_JSON
public static final String BLOCK_SIZE_JSON
public static final String REPLICATION_JSON
public static final String FILE_CHECKSUM_JSON
public static final String CHECKSUM_ALGORITHM_JSON
public static final String CHECKSUM_BYTES_JSON
public static final String CHECKSUM_LENGTH_JSON
public static final String CONTENT_SUMMARY_JSON
public static final String CONTENT_SUMMARY_DIRECTORY_COUNT_JSON
public static final String CONTENT_SUMMARY_FILE_COUNT_JSON
public static final String CONTENT_SUMMARY_LENGTH_JSON
public static final String CONTENT_SUMMARY_QUOTA_JSON
public static final String CONTENT_SUMMARY_SPACE_CONSUMED_JSON
public static final String CONTENT_SUMMARY_SPACE_QUOTA_JSON
public static final String ERROR_JSON
public static final String ERROR_EXCEPTION_JSON
public static final String ERROR_CLASSNAME_JSON
public static final String ERROR_MESSAGE_JSON
public static final int HTTP_TEMPORARY_REDIRECT
public void initialize(URI name, Configuration conf) throws IOException
initialize in class FileSystemname - a uri whose authority section names the host, port, etc. for this FileSystemconf - the configurationIOExceptionpublic String getScheme()
FileSystemUnsupportedOperationException.getScheme in class FileSystempublic URI getUri()
getUri in class FileSystemprotected int getDefaultPort()
getDefaultPort in class FileSystempublic FSDataInputStream open(Path f, int bufferSize) throws IOException
does not support the
PositionReadable and Seekable methods. open in class FileSystemf - the file name to openbufferSize - the size of the buffer to be used.IOExceptionpublic static String permissionToString(FsPermission p)
FsPermission to a Unix octal representation.p - the permission.public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
Progressable parameter is not used.create in class FileSystemf - 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.IOExceptionsetPermission(Path, FsPermission)public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
Progressable parameter is not used.append in class FileSystemf - the existing file to be appended.bufferSize - the size of the buffer to be used.progress - for reporting progress if it is not null.IOExceptionpublic void concat(Path f, Path[] psrcs) throws IOException
concat in class FileSystemf - the path to the target destination.psrcs - the paths to the sources to use for the concatenation.IOExceptionpublic boolean rename(Path src, Path dst) throws IOException
rename in class FileSystemsrc - path to be renameddst - new path after renameIOException - on failure@Deprecated public boolean delete(Path f) throws IOException
delete in class FileSystemIOExceptionpublic boolean delete(Path f, boolean recursive) throws IOException
delete in class FileSystemf - 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.IOExceptionpublic FileStatus[] listStatus(Path f) throws IOException
listStatus in class FileSystemf - given pathIOExceptionFileNotFoundException - when the path does not exist;
IOException see specific implementationpublic void setWorkingDirectory(Path newDir)
setWorkingDirectory in class FileSystemnewDir - new directory.public Path getWorkingDirectory()
getWorkingDirectory in class FileSystempublic boolean mkdirs(Path f, FsPermission permission) throws IOException
mkdirs in class FileSystemf - path to createpermission - to apply to fIOExceptionpublic FileStatus getFileStatus(Path f) throws IOException
getFileStatus in class FileSystemf - The path we want information fromFileNotFoundException - when the path does not exist;
IOException see specific implementationIOExceptionpublic Path getHomeDirectory()
getHomeDirectory in class FileSystempublic void setOwner(Path p, String username, String groupname) throws IOException
setOwner in class FileSystemp - The pathusername - If it is null, the original username remains unchanged.groupname - If it is null, the original groupname remains unchanged.IOExceptionpublic void setPermission(Path p, FsPermission permission) throws IOException
setPermission in class FileSystemp - path.permission - permission.IOExceptionpublic void setTimes(Path p, long mtime, long atime) throws IOException
setTimes in class FileSystemp - 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.IOExceptionpublic boolean setReplication(Path src, short replication) throws IOException
setReplication in class FileSystemsrc - file namereplication - new replicationIOExceptionpublic ContentSummary getContentSummary(Path f) throws IOException
FileSystemContentSummary of a given Path.getContentSummary in class FileSystemf - path to useIOExceptionpublic FileChecksum getFileChecksum(Path f) throws IOException
FileSystemgetFileChecksum in class FileSystemf - The file pathIOExceptionpublic Token<?> getDelegationToken(String renewer) throws IOException
FileSystemFileSystem.addDelegationTokens(String, Credentials)getDelegationToken in class FileSystemrenewer - the account name that is allowed to renew the token.IOExceptionpublic long renewDelegationToken(Token<?> token) throws IOException
IOExceptionpublic void cancelDelegationToken(Token<?> token) throws IOException
IOExceptionpublic Token<?> getRenewToken()
getRenewToken in interface DelegationTokenRenewer.Renewablepublic <T extends TokenIdentifier> void setDelegationToken(Token<T> token)
DelegationTokenRenewer.RenewablesetDelegationToken in interface DelegationTokenRenewer.RenewableCopyright © 2013 Apache Software Foundation. All rights reserved.