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, startLocalOutput
getConf, setConf
public 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()
FileSystem
getDefaultPort
在类中 FileSystem
protected InetSocketAddress getNamenodeAddr(URI uri)
public String getCanonicalServiceName()
FileSystem
getCanonicalServiceName
在类中 FileSystem
SecurityUtil.buildDTServiceName(URI, int)
public void initialize(URI name, Configuration conf) throws IOException
FileSystem
initialize
在类中 FileSystem
name
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configurationIOException
protected void initDelegationToken() throws IOException
IOException
protected Token<DelegationTokenIdentifier> selectHftpDelegationToken()
protected Token<DelegationTokenIdentifier> selectHdfsDelegationToken()
public void close() throws IOException
FileSystem
close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 FileSystem
IOException
public Token<?> getRenewToken()
getRenewToken
在接口中 DelegationTokenRenewer.Renewable
protected String getUnderlyingProtocol()
public <T extends TokenIdentifier> void setDelegationToken(Token<T> token)
DelegationTokenRenewer.Renewable
public Token<?> getDelegationToken(String renewer) throws IOException
FileSystem
getDelegationToken
在类中 FileSystem
renewer
- the account name that is allowed to renew the token.IOException
public URI getUri()
FileSystem
getUri
在类中 FileSystem
protected HttpURLConnection openConnection(String path, String query) throws IOException
path
- The path component of the URLquery
- The query component of the URLIOException
protected String updateQuery(String query) throws IOException
IOException
public FSDataInputStream open(Path f, int buffersize) throws IOException
FileSystem
open
在类中 FileSystem
f
- the file name to openbuffersize
- the size of the buffer to be used.IOException
public FileStatus[] listStatus(Path f) throws IOException
FileSystem
listStatus
在类中 FileSystem
f
- given pathIOException
public FileStatus getFileStatus(Path f) throws IOException
FileSystem
getFileStatus
在类中 FileSystem
f
- The path we want information fromFileNotFoundException
- when the path does not exist;
IOException see specific implementationIOException
public FileChecksum getFileChecksum(Path f) throws IOException
getFileChecksum
在类中 FileSystem
f
- The file pathIOException
public Path getWorkingDirectory()
FileSystem
getWorkingDirectory
在类中 FileSystem
public void setWorkingDirectory(Path f)
FileSystem
setWorkingDirectory
在类中 FileSystem
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
append
在类中 FileSystem
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.IOException
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystem
create
在类中 FileSystem
f
- 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.IOException
FileSystem.setPermission(Path, FsPermission)
public boolean rename(Path src, Path dst) throws IOException
FileSystem
rename
在类中 FileSystem
IOException
@Deprecated public boolean delete(Path f) throws IOException
delete
在类中 FileSystem
IOException
public boolean delete(Path f, boolean recursive) throws IOException
FileSystem
delete
在类中 FileSystem
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.IOException
public boolean mkdirs(Path f, FsPermission permission) throws IOException
FileSystem
mkdirs
在类中 FileSystem
IOException
public ContentSummary getContentSummary(Path f) throws IOException
ContentSummary
of a given Path
.getContentSummary
在类中 FileSystem
IOException
Copyright © 2009 The Apache Software Foundation