public class HarFileSystem extends FilterFileSystem
FileSystem.Statistics| 限定符和类型 | 字段和说明 |
|---|---|
static int |
VERSION |
fsFS_DEFAULT_NAME_KEY, LOG, statistics| 构造器和说明 |
|---|
HarFileSystem()
public construction of harfilesystem
|
HarFileSystem(FileSystem fs)
Constructor to create a HarFileSystem with an
underlying filesystem.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
No more filesystem operations are needed.
|
void |
completeLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
not implemented.
|
void |
copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
not implemented.
|
void |
copyToLocalFile(boolean delSrc,
Path src,
Path dst)
copies the file in the har filesystem to a local file.
|
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.
|
FSDataOutputStream |
create(Path f,
int bufferSize) |
boolean |
delete(Path f,
boolean recursive)
Not implemented.
|
String |
getCanonicalServiceName()
Get a canonical service name for this file system.
|
BlockLocation[] |
getFileBlockLocations(FileStatus file,
long start,
long len)
Get block locations from the underlying fs and fix their
offsets and lengths.
|
FileChecksum |
getFileChecksum(Path f)
Get the checksum of a file.
|
FileStatus |
getFileStatus(Path f)
return the filestatus of files in har archive.
|
static int |
getHarHash(Path p)
the hash of the path p inside iniside
the filesystem
|
int |
getHarVersion() |
Path |
getHomeDirectory()
return the top level archive path.
|
URI |
getUri()
Returns the uri of this filesystem.
|
Path |
getWorkingDirectory()
return the top level archive.
|
void |
initialize(URI name,
Configuration conf)
Initialize a Har filesystem per har archive.
|
FileStatus[] |
listStatus(Path f)
liststatus returns the children of a directory
after looking up the index files.
|
Path |
makeQualified(Path path)
Make sure that a path specifies a FileSystem.
|
boolean |
mkdirs(Path f,
FsPermission permission)
not implemented.
|
FSDataInputStream |
open(Path f,
int bufferSize)
Returns a har input stream which fakes end of
file.
|
void |
setOwner(Path p,
String username,
String groupname)
not implemented.
|
void |
setPermission(Path p,
FsPermission permisssion)
Not implemented.
|
boolean |
setReplication(Path src,
short replication)
Not implemented.
|
void |
setWorkingDirectory(Path newDir)
Set the current working directory for the given file system.
|
Path |
startLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
not implemented.
|
append, checkPath, concat, delete, getConf, getDefaultBlockSize, getDefaultReplication, getName, rename, setVerifyChecksumaddFileSystemForTesting, append, append, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getCacheSize, getCanonicalUri, getContentSummary, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultUri, getDelegationToken, getLength, getLocal, getNamed, getReplication, getStatistics, getStatistics, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, open, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setTimessetConfpublic static final int VERSION
public HarFileSystem()
public HarFileSystem(FileSystem fs)
fs - public void initialize(URI name, Configuration conf) throws IOException
initialize 在类中 FilterFileSystemname - a uri whose authority section names the host, port, etc.
for this FileSystemconf - the configurationIOExceptionpublic int getHarVersion()
throws IOException
IOExceptionpublic Path getWorkingDirectory()
getWorkingDirectory 在类中 FilterFileSystempublic URI getUri()
getUri 在类中 FilterFileSystempublic String getCanonicalServiceName()
FileSystemgetCanonicalServiceName 在类中 FilterFileSystemSecurityUtil.buildDTServiceName(URI, int)public Path makeQualified(Path path)
FilterFileSystemmakeQualified 在类中 FilterFileSystempublic BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException
getFileBlockLocations 在类中 FilterFileSystemfile - the input filestatus to get block locationsstart - the start of the desired range in the contained filelen - the length of the desired rangeIOExceptionpublic static int getHarHash(Path p)
p - the path in the harfilesystempublic FileStatus getFileStatus(Path f) throws IOException
getFileStatus 在类中 FilterFileSystemf - the path in har filesystemIOExceptionFileNotFoundException - when the path does not exist;
IOException see specific implementationpublic FileChecksum getFileChecksum(Path f)
FilterFileSystemgetFileChecksum 在类中 FilterFileSystemf - The file pathpublic FSDataInputStream open(Path f, int bufferSize) throws IOException
open 在类中 FilterFileSystemf - the file name to openbufferSize - the size of the buffer to be used.IOExceptionpublic FSDataOutputStream create(Path f, int bufferSize) throws IOException
IOExceptionpublic FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystemcreate 在类中 FilterFileSystemf - 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 void close()
throws IOException
FileSystemclose 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FilterFileSystemIOExceptionpublic boolean setReplication(Path src, short replication) throws IOException
setReplication 在类中 FilterFileSystemsrc - file namereplication - new replicationIOExceptionpublic boolean delete(Path f, boolean recursive) throws IOException
delete 在类中 FilterFileSystemf - 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 在类中 FilterFileSystemf - given pathIOExceptionpublic Path getHomeDirectory()
getHomeDirectory 在类中 FilterFileSystempublic void setWorkingDirectory(Path newDir)
FilterFileSystemsetWorkingDirectory 在类中 FilterFileSystempublic boolean mkdirs(Path f, FsPermission permission) throws IOException
mkdirs 在类中 FilterFileSystemIOExceptionpublic void copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
copyFromLocalFile 在类中 FilterFileSystemIOExceptionpublic void copyToLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
copyToLocalFile 在类中 FilterFileSystemIOExceptionpublic Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
startLocalOutput 在类中 FilterFileSystemIOExceptionpublic void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
completeLocalOutput 在类中 FilterFileSystemIOExceptionpublic void setOwner(Path p, String username, String groupname) throws IOException
setOwner 在类中 FilterFileSystemp - 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 permisssion) throws IOException
setPermission 在类中 FilterFileSystemIOExceptionCopyright © 2009 The Apache Software Foundation