public class HarFileSystem extends FileSystem
FileSystem.Statistics| Modifier and Type | Field and Description |
|---|---|
static int |
METADATA_CACHE_ENTRIES_DEFAULT |
static String |
METADATA_CACHE_ENTRIES_KEY |
static int |
VERSION |
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics| Constructor and Description |
|---|
HarFileSystem()
public construction of harfilesystem
|
HarFileSystem(FileSystem fs)
Constructor to create a HarFileSystem with an
underlying filesystem.
|
| Modifier and Type | Method and Description |
|---|---|
FSDataOutputStream |
append(Path f)
Append to an existing file (optional operation).
|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
Append to an existing file (optional operation).
|
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)
Create an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
boolean |
delete(Path f,
boolean recursive)
Not implemented.
|
protected URI |
getCanonicalUri()
Return a canonicalized form of this FileSystem's URI.
|
Configuration |
getConf()
Return the configuration used by this object.
|
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 the filesystem
|
int |
getHarVersion() |
Path |
getHomeDirectory()
return the top level archive path.
|
String |
getScheme()
Return the protocol scheme for the FileSystem.
|
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.
|
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
void |
setOwner(Path p,
String username,
String groupname)
not implemented.
|
void |
setPermission(Path p,
FsPermission permission)
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.
|
addDelegationTokens, append, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, closeAll, closeAllForUGI, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getCanonicalServiceName, getChildFileSystems, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getDelegationToken, 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, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, renameSnapshot, resolveLink, resolvePath, setDefaultUri, setDefaultUri, setTimes, setVerifyChecksum, setWriteChecksum, supportsSymlinkssetConfpublic static final String METADATA_CACHE_ENTRIES_KEY
public static final int METADATA_CACHE_ENTRIES_DEFAULT
public static final int VERSION
public HarFileSystem()
public HarFileSystem(FileSystem fs)
fs - underlying file systempublic String getScheme()
getScheme in class FileSystemharpublic 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 Configuration getConf()
ConfigurablegetConf in interface ConfigurablegetConf in class Configuredpublic int getHarVersion()
throws IOException
IOExceptionpublic Path getWorkingDirectory()
getWorkingDirectory in class FileSystemprotected URI getCanonicalUri()
FileSystemFileSystem.canonicalizeUri(URI)
on the filesystem's own URI, so subclasses typically only need to
implement that method.getCanonicalUri in class FileSystemFileSystem.canonicalizeUri(URI)public URI getUri()
getUri in class FileSystempublic Path makeQualified(Path path)
FileSystemmakeQualified in class FileSystempath - to usepublic BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException
getFileBlockLocations in class FileSystemfile - the input file status 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 in class FileSystemf - the path in har filesystemIOExceptionFileNotFoundException - when the path does not exist;
IOException see specific implementationpublic FileChecksum getFileChecksum(Path f)
FileSystemgetFileChecksum in class FileSystemf - The file pathpublic FSDataInputStream open(Path f, int bufferSize) throws IOException
open in class FileSystemf - the file name to openbufferSize - the size of the buffer to be used.IOExceptionpublic FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystemcreate in class 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 FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
FileSystemappend 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 close()
throws IOException
FileSystemclose in interface Closeableclose in interface AutoCloseableclose in class FileSystemIOExceptionpublic boolean setReplication(Path src, short replication) throws IOException
setReplication in class FileSystemsrc - file namereplication - new replicationIOExceptionpublic boolean rename(Path src, Path dst) throws IOException
FileSystemrename in class FileSystemsrc - path to be renameddst - new path after renameIOException - on failurepublic FSDataOutputStream append(Path f) throws IOException
FileSystemappend in class FileSystemf - the existing file to be appended.IOExceptionpublic 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 pathFileNotFoundException - when the path does not exist;
IOException see specific implementationIOExceptionpublic Path getHomeDirectory()
getHomeDirectory in class FileSystempublic void setWorkingDirectory(Path newDir)
FileSystemsetWorkingDirectory in class FileSystempublic boolean mkdirs(Path f, FsPermission permission) throws IOException
mkdirs in class FileSystemf - path to createpermission - to apply to fIOExceptionpublic void copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
copyFromLocalFile in class FileSystemdelSrc - whether to delete the srcsrc - pathdst - pathIOExceptionpublic void copyToLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
copyToLocalFile in class FileSystemdelSrc - whether to delete the srcsrc - pathdst - pathIOExceptionpublic Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
startLocalOutput in class FileSystemfsOutputFile - path of output filetmpLocalFile - path of local tmp fileIOExceptionpublic void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
completeLocalOutput in class FileSystemfsOutputFile - path of output filetmpLocalFile - path to local tmp fileIOExceptionpublic 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 FileSystemIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.