@InterfaceAudience.Public @InterfaceStability.Evolving public class ViewFileSystem extends FileSystem
ViewFs.DEFAULT_FILTER, DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics| Constructor and Description |
|---|
ViewFileSystem()
This is the constructor with the signature needed by
FileSystem.createFileSystem(URI, Configuration)
After this constructor is called initialize() is called. |
ViewFileSystem(Configuration conf)
Convenience Constructor for apps to call directly
|
| Modifier and Type | Method and Description |
|---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
Append to an existing file (optional operation).
|
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)
Delete a file
|
boolean |
delete(Path f,
boolean recursive)
Delete a file.
|
FileSystem[] |
getChildFileSystems()
Get all the immediate child FileSystems embedded in this FileSystem.
|
ContentSummary |
getContentSummary(Path f)
Return the
ContentSummary of a given Path. |
long |
getDefaultBlockSize()
Return the number of bytes that large input files should be optimally
be split into to minimize i/o time.
|
long |
getDefaultBlockSize(Path f)
Return the number of bytes that large input files should be optimally
be split into to minimize i/o time.
|
short |
getDefaultReplication()
Get the default replication.
|
short |
getDefaultReplication(Path f)
Get the default replication for a path.
|
BlockLocation[] |
getFileBlockLocations(FileStatus fs,
long start,
long len)
Return an array containing hostnames, offset and size of
portions of the given file.
|
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.
|
org.apache.hadoop.fs.viewfs.ViewFileSystem.MountPoint[] |
getMountPoints() |
FsServerDefaults |
getServerDefaults()
Return a set of server default configuration values
|
FsServerDefaults |
getServerDefaults(Path f)
Return a set of server default configuration values
|
Path |
getTrashCanLocation(Path f) |
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 theUri,
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 dir,
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.
|
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
Path |
resolvePath(Path f)
Return the fully-qualified path of path f resolving the path
through any symlinks or mount point
|
void |
setOwner(Path f,
String username,
String groupname)
Set owner of a path (i.e.
|
void |
setPermission(Path f,
FsPermission permission)
Set permission of a path.
|
boolean |
setReplication(Path f,
short replication)
Set replication for an existing file.
|
void |
setTimes(Path f,
long mtime,
long atime)
Set access time of a file
|
void |
setVerifyChecksum(boolean verifyChecksum)
Set the verify checksum flag.
|
void |
setWorkingDirectory(Path new_dir)
Set the current working directory for the given file system.
|
void |
setWriteChecksum(boolean writeChecksum)
Set the write checksum flag.
|
append, append, cancelDeleteOnExit, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getCanonicalUri, getDefaultPort, getDefaultUri, getFileBlockLocations, getInitialWorkingDirectory, getLength, getLocal, getName, getNamed, getReplication, getStatistics, getStatistics, getStatus, getStatus, getUsed, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, setDefaultUri, setDefaultUri, startLocalOutputgetConf, setConfpublic ViewFileSystem() throws IOException
FileSystem.createFileSystem(URI, Configuration)
After this constructor is called initialize() is called.IOExceptionpublic ViewFileSystem(Configuration conf) throws IOException
conf - IOExceptionpublic void initialize(URI theUri, Configuration conf) throws IOException
initialize in class FileSystemtheUri - a uri whose authority section names the host, port, etc. for
this FileSystemconf - the configurationIOExceptionpublic Path getTrashCanLocation(Path f) throws FileNotFoundException
FileNotFoundExceptionpublic URI getUri()
FileSystemgetUri in class FileSystempublic Path resolvePath(Path f) throws IOException
FileSystemresolvePath in class FileSystemf - path to be resolvedFileNotFoundExceptionIOExceptionpublic Path getHomeDirectory()
FileSystemgetHomeDirectory in class FileSystempublic Path getWorkingDirectory()
FileSystemgetWorkingDirectory in class FileSystempublic void setWorkingDirectory(Path new_dir)
FileSystemsetWorkingDirectory in class FileSystempublic 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 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 boolean delete(Path f, boolean recursive) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemdelete 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.IOExceptionorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionpublic boolean delete(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemdelete in class FileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic BlockLocation[] getFileBlockLocations(FileStatus fs, long start, long len) throws IOException
FileSystemgetFileBlockLocations in class FileSystemfs - FilesStatus to get data fromstart - offset into the given filelen - length for which to get locations forIOExceptionpublic FileChecksum getFileChecksum(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemgetFileChecksum in class FileSystemf - The file pathorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic FileStatus getFileStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemgetFileStatus in class FileSystemf - The path we want information fromFileNotFoundException - when the path does not exist;
IOException see specific implementationorg.apache.hadoop.security.AccessControlExceptionIOExceptionpublic FileStatus[] listStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemlistStatus in class FileSystemf - given pathFileNotFoundException - when the path does not exist;
IOException see specific implementationorg.apache.hadoop.security.AccessControlExceptionIOExceptionpublic boolean mkdirs(Path dir, FsPermission permission) throws IOException
FileSystemmkdirs in class FileSystemdir - path to createpermission - to apply to fIOExceptionpublic FSDataInputStream open(Path f, int bufferSize) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemopen in class FileSystemf - the file name to openbufferSize - the size of the buffer to be used.org.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic boolean rename(Path src, Path dst) throws IOException
FileSystemrename in class FileSystemsrc - path to be renameddst - new path after renameIOException - on failurepublic void setOwner(Path f, String username, String groupname) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetOwner in class FileSystemf - The pathusername - If it is null, the original username remains unchanged.groupname - If it is null, the original groupname remains unchanged.org.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic void setPermission(Path f, FsPermission permission) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetPermission in class FileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic boolean setReplication(Path f, short replication) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetReplication in class FileSystemf - file namereplication - new replicationIOExceptionorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionpublic void setTimes(Path f, long mtime, long atime) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetTimes in class FileSystemf - 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.org.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic void setVerifyChecksum(boolean verifyChecksum)
FileSystemsetVerifyChecksum in class FileSystempublic long getDefaultBlockSize()
FileSystemgetDefaultBlockSize in class FileSystempublic short getDefaultReplication()
FileSystemgetDefaultReplication in class FileSystempublic FsServerDefaults getServerDefaults() throws IOException
FileSystemgetServerDefaults in class FileSystemIOExceptionpublic long getDefaultBlockSize(Path f)
FileSystemgetDefaultBlockSize in class FileSystemf - path of filepublic short getDefaultReplication(Path f)
FileSystemgetDefaultReplication in class FileSystemf - of the filepublic FsServerDefaults getServerDefaults(Path f) throws IOException
FileSystemgetServerDefaults in class FileSystemf - path is used to identify an FS since an FS could have
another FS that it could be delegating the call toIOExceptionpublic ContentSummary getContentSummary(Path f) throws IOException
FileSystemContentSummary of a given Path.getContentSummary in class FileSystemf - path to useIOExceptionpublic void setWriteChecksum(boolean writeChecksum)
FileSystemsetWriteChecksum in class FileSystempublic FileSystem[] getChildFileSystems()
FileSystempublic org.apache.hadoop.fs.viewfs.ViewFileSystem.MountPoint[] getMountPoints()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.