public class HftpFileSystem extends FileSystem implements DelegationTokenRenewer.Renewable
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HftpFileSystem.TokenManager |
FileSystem.Statistics| 限定符和类型 | 字段和说明 |
|---|---|
protected static ThreadLocal<SimpleDateFormat> |
df |
static String |
HFTP_DATE_FORMAT |
static String |
HFTP_TIMEZONE |
protected InetSocketAddress |
nnAddr |
static Text |
TOKEN_KIND |
protected UserGroupInformation |
ugi |
FS_DEFAULT_NAME_KEY, LOG, statistics| 构造器和说明 |
|---|
HftpFileSystem() |
| 限定符和类型 | 方法和说明 |
|---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
This optional operation is not yet supported.
|
void |
close()
No more filesystem operations are needed.
|
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)
已过时。
|
boolean |
delete(Path f,
boolean recursive)
Delete a file.
|
String |
getCanonicalServiceName()
Get a canonical service name for this file system.
|
ContentSummary |
getContentSummary(Path f)
Return the
ContentSummary of a given Path. |
static SimpleDateFormat |
getDateFormat() |
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.
|
protected InetSocketAddress |
getNamenodeAddr(URI uri) |
Token<?> |
getRenewToken() |
protected String |
getUnderlyingProtocol()
Return the underlying protocol that is used to talk to the namenode.
|
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
Path |
getWorkingDirectory()
Get the current working directory for the given file system
|
protected void |
initDelegationToken() |
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.
|
protected HttpURLConnection |
openConnection(String path,
String query)
Open an HTTP connection to the namenode to read file data and metadata.
|
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
protected Token<DelegationTokenIdentifier> |
selectHdfsDelegationToken() |
protected Token<DelegationTokenIdentifier> |
selectHftpDelegationToken() |
<T extends TokenIdentifier> |
setDelegationToken(Token<T> token)
Set delegation token.
|
void |
setWorkingDirectory(Path f)
Set the current working directory for the given file system.
|
protected String |
updateQuery(String query) |
addFileSystemForTesting, append, append, checkPath, clearStatistics, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getCacheSize, getCanonicalUri, getDefaultBlockSize, getDefaultBlockSize, getDefaultReplication, getDefaultReplication, getDefaultUri, getFileBlockLocations, getHomeDirectory, getLength, getLocal, getName, getNamed, getReplication, getStatistics, getStatistics, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, open, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setOwner, setPermission, setReplication, setTimes, setVerifyChecksum, startLocalOutputgetConf, setConfpublic static final Text TOKEN_KIND
protected UserGroupInformation ugi
protected InetSocketAddress nnAddr
protected static final ThreadLocal<SimpleDateFormat> df
public static final SimpleDateFormat getDateFormat()
protected int getDefaultPort()
FileSystemgetDefaultPort 在类中 FileSystemprotected InetSocketAddress getNamenodeAddr(URI uri)
public String getCanonicalServiceName()
FileSystemgetCanonicalServiceName 在类中 FileSystemSecurityUtil.buildDTServiceName(URI, int)public void initialize(URI name, Configuration conf) throws IOException
FileSysteminitialize 在类中 FileSystemname - a uri whose authority section names the host, port, etc.
for this FileSystemconf - the configurationIOExceptionprotected void initDelegationToken()
throws IOException
IOExceptionprotected Token<DelegationTokenIdentifier> selectHftpDelegationToken()
protected Token<DelegationTokenIdentifier> selectHdfsDelegationToken()
public void close()
throws IOException
FileSystemclose 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FileSystemIOExceptionpublic Token<?> getRenewToken()
getRenewToken 在接口中 DelegationTokenRenewer.Renewableprotected String getUnderlyingProtocol()
public <T extends TokenIdentifier> void setDelegationToken(Token<T> token)
DelegationTokenRenewer.Renewablepublic Token<?> getDelegationToken(String renewer) throws IOException
FileSystemgetDelegationToken 在类中 FileSystemrenewer - the account name that is allowed to renew the token.IOExceptionpublic URI getUri()
FileSystemgetUri 在类中 FileSystemprotected HttpURLConnection openConnection(String path, String query) throws IOException
path - The path component of the URLquery - The query component of the URLIOExceptionprotected String updateQuery(String query) throws IOException
IOExceptionpublic FSDataInputStream open(Path f, int buffersize) throws IOException
FileSystemopen 在类中 FileSystemf - the file name to openbuffersize - the size of the buffer to be used.IOExceptionpublic FileStatus[] listStatus(Path f) throws IOException
FileSystemlistStatus 在类中 FileSystemf - given pathIOExceptionpublic FileStatus getFileStatus(Path f) throws IOException
FileSystemgetFileStatus 在类中 FileSystemf - The path we want information fromFileNotFoundException - when the path does not exist;
IOException see specific implementationIOExceptionpublic FileChecksum getFileChecksum(Path f) throws IOException
getFileChecksum 在类中 FileSystemf - The file pathIOExceptionpublic Path getWorkingDirectory()
FileSystemgetWorkingDirectory 在类中 FileSystempublic void setWorkingDirectory(Path f)
FileSystemsetWorkingDirectory 在类中 FileSystempublic FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
append 在类中 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 FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystemcreate 在类中 FileSystemf - the file name to openoverwrite - 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.IOExceptionFileSystem.setPermission(Path, FsPermission)public boolean rename(Path src, Path dst) throws IOException
FileSystemrename 在类中 FileSystemIOException@Deprecated public boolean delete(Path f) throws IOException
delete 在类中 FileSystemIOExceptionpublic boolean delete(Path f, boolean recursive) throws IOException
FileSystemdelete 在类中 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 boolean mkdirs(Path f, FsPermission permission) throws IOException
FileSystemmkdirs 在类中 FileSystemIOExceptionpublic ContentSummary getContentSummary(Path f) throws IOException
ContentSummary of a given Path.getContentSummary 在类中 FileSystemIOExceptionCopyright © 2009 The Apache Software Foundation