| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.viewfs.ViewFileSystem
@InterfaceAudience.Public @InterfaceStability.Evolving public class ViewFileSystem
ViewFileSystem (extends the FileSystem interface) implements a client-side
 mount table. Its spec and implementation is identical to ViewFs.
| Field Summary | 
|---|
| Fields inherited from class org.apache.hadoop.fs.FileSystem | 
|---|
| DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics | 
| Constructor Summary | |
|---|---|
| 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 | |
| Method Summary | |
|---|---|
|  void | access(Path path,
             FsAction mode)Checks if the user can access a path. | 
|  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. | 
|  FSDataOutputStream | createNonRecursive(Path f,
                                     FsPermission permission,
                                     EnumSet<CreateFlag> flags,
                                     int bufferSize,
                                     short replication,
                                     long blockSize,
                                     Progressable progress)Opens 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. | 
|  AclStatus | getAclStatus(Path path)Gets the ACL of a file or directory. | 
|  FileSystem[] | getChildFileSystems()Get all the immediate child FileSystems embedded in this FileSystem. | 
|  ContentSummary | getContentSummary(Path f)Return the ContentSummaryof a givenPath. | 
|  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() | 
|  String | getScheme()Return the protocol scheme for the FileSystem. | 
|  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 | 
|  byte[] | getXAttr(Path path,
                 String name)Get an xattr name and value for a file or directory. | 
|  Map<String,byte[]> | getXAttrs(Path path)Get all of the xattr name/value pairs for a file or directory. | 
|  Map<String,byte[]> | getXAttrs(Path path,
                   List<String> names)Get all of the xattrs name/value pairs for a file or directory. | 
|  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. | 
|  List<String> | listXAttrs(Path path)Get all of the xattr names for a file or directory. | 
|  boolean | mkdirs(Path dir,
             FsPermission permission)Make the given file and all non-existent parents into directories. | 
|  void | modifyAclEntries(Path path,
                                 List<AclEntry> aclSpec)Modifies ACL entries of files and directories. | 
|  FSDataInputStream | open(Path f,
         int bufferSize)Opens an FSDataInputStream at the indicated Path. | 
|  void | removeAcl(Path path)Removes all but the base ACL entries of files and directories. | 
|  void | removeAclEntries(Path path,
                                 List<AclEntry> aclSpec)Removes ACL entries from files and directories. | 
|  void | removeDefaultAcl(Path path)Removes all default ACL entries from files and directories. | 
|  void | removeXAttr(Path path,
                       String name)Remove an xattr of a file or directory. | 
|  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 | setAcl(Path path,
             List<AclEntry> aclSpec)Fully replaces ACL of files and directories, discarding all existing entries. | 
|  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. | 
|  void | setXAttr(Path path,
                 String name,
                 byte[] value,
                 EnumSet<XAttrSetFlag> flag)Set an xattr of a file or directory. | 
| Methods inherited from class org.apache.hadoop.conf.Configured | 
|---|
| getConf, setConf | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ViewFileSystem()
               throws IOException
FileSystem.createFileSystem(URI, Configuration)
 
 After this constructor is called initialize() is called.
IOException
public ViewFileSystem(Configuration conf)
               throws IOException
conf - 
IOException| Method Detail | 
|---|
public String getScheme()
getScheme in class FileSystemviewfs
public 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 configuration
IOException
public Path getTrashCanLocation(Path f)
                         throws FileNotFoundException
FileNotFoundExceptionpublic URI getUri()
FileSystem
getUri in class FileSystem
public Path resolvePath(Path f)
                 throws IOException
FileSystem
resolvePath in class FileSystemf - path to be resolved
FileNotFoundException
IOExceptionpublic Path getHomeDirectory()
FileSystem
getHomeDirectory in class FileSystempublic Path getWorkingDirectory()
FileSystem
getWorkingDirectory in class FileSystempublic void setWorkingDirectory(Path new_dir)
FileSystem
setWorkingDirectory in class FileSystem
public FSDataOutputStream append(Path f,
                                 int bufferSize,
                                 Progressable progress)
                          throws IOException
FileSystem
append 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.
IOException
public FSDataOutputStream createNonRecursive(Path f,
                                             FsPermission permission,
                                             EnumSet<CreateFlag> flags,
                                             int bufferSize,
                                             short replication,
                                             long blockSize,
                                             Progressable progress)
                                      throws IOException
FileSystem
createNonRecursive in class FileSystemf - the file name to openflags - CreateFlags to use for this stream.bufferSize - the size of the buffer to be used.replication - required block replication for the file.
IOExceptionFileSystem.setPermission(Path, FsPermission)
public FSDataOutputStream create(Path f,
                                 FsPermission permission,
                                 boolean overwrite,
                                 int bufferSize,
                                 short replication,
                                 long blockSize,
                                 Progressable progress)
                          throws IOException
FileSystem
create 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
FileSystem
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.
IOException
org.apache.hadoop.security.AccessControlException
FileNotFoundException
public boolean delete(Path f)
               throws org.apache.hadoop.security.AccessControlException,
                      FileNotFoundException,
                      IOException
FileSystem
delete in class FileSystemorg.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
public BlockLocation[] getFileBlockLocations(FileStatus fs,
                                             long start,
                                             long len)
                                      throws IOException
FileSystem
getFileBlockLocations in class FileSystemfs - FilesStatus to get data fromstart - offset into the given filelen - length for which to get locations for
IOException
public FileChecksum getFileChecksum(Path f)
                             throws org.apache.hadoop.security.AccessControlException,
                                    FileNotFoundException,
                                    IOException
FileSystem
getFileChecksum in class FileSystemf - The file path
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
public FileStatus getFileStatus(Path f)
                         throws org.apache.hadoop.security.AccessControlException,
                                FileNotFoundException,
                                IOException
FileSystem
getFileStatus in class FileSystemf - The path we want information from
FileNotFoundException - when the path does not exist;
         IOException see specific implementation
org.apache.hadoop.security.AccessControlException
IOException
public void access(Path path,
                   FsAction mode)
            throws org.apache.hadoop.security.AccessControlException,
                   FileNotFoundException,
                   IOException
FileSystemAccessControlException.
 
 The default implementation of this method calls FileSystem.getFileStatus(Path)
 and checks the returned permissions against the requested permissions.
 Note that the getFileStatus call will be subject to authorization checks.
 Typically, this requires search (execute) permissions on each directory in
 the path's prefix, but this is implementation-defined.  Any file system
 that provides a richer authorization model (such as ACLs) may override the
 default implementation so that it checks against that model instead.
 
 In general, applications should avoid using this method, due to the risk of
 time-of-check/time-of-use race conditions.  The permissions on a file may
 change immediately after the access call returns.  Most applications should
 prefer running specific file system actions as the desired user represented
 by a UserGroupInformation.
path - Path to checkmode - type of access to check
org.apache.hadoop.security.AccessControlException - if access is denied
FileNotFoundException - if the path does not exist
IOException - see specific implementation
public FileStatus[] listStatus(Path f)
                        throws org.apache.hadoop.security.AccessControlException,
                               FileNotFoundException,
                               IOException
FileSystem
listStatus in class FileSystemf - given path
FileNotFoundException - when the path does not exist;
         IOException see specific implementation
org.apache.hadoop.security.AccessControlException
IOException
public boolean mkdirs(Path dir,
                      FsPermission permission)
               throws IOException
FileSystem
mkdirs in class FileSystemdir - path to createpermission - to apply to f
IOException
public FSDataInputStream open(Path f,
                              int bufferSize)
                       throws org.apache.hadoop.security.AccessControlException,
                              FileNotFoundException,
                              IOException
FileSystem
open in class FileSystemf - the file name to openbufferSize - the size of the buffer to be used.
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
public boolean rename(Path src,
                      Path dst)
               throws IOException
FileSystem
rename in class FileSystemsrc - path to be renameddst - new path after rename
IOException - on failure
public void setOwner(Path f,
                     String username,
                     String groupname)
              throws org.apache.hadoop.security.AccessControlException,
                     FileNotFoundException,
                     IOException
FileSystem
setOwner 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.AccessControlException
FileNotFoundException
IOException
public void setPermission(Path f,
                          FsPermission permission)
                   throws org.apache.hadoop.security.AccessControlException,
                          FileNotFoundException,
                          IOException
FileSystem
setPermission in class FileSystemorg.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
public boolean setReplication(Path f,
                              short replication)
                       throws org.apache.hadoop.security.AccessControlException,
                              FileNotFoundException,
                              IOException
FileSystem
setReplication in class FileSystemf - file namereplication - new replication
IOException
org.apache.hadoop.security.AccessControlException
FileNotFoundException
public void setTimes(Path f,
                     long mtime,
                     long atime)
              throws org.apache.hadoop.security.AccessControlException,
                     FileNotFoundException,
                     IOException
FileSystem
setTimes 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.AccessControlException
FileNotFoundException
IOException
public void modifyAclEntries(Path path,
                             List<AclEntry> aclSpec)
                      throws IOException
FileSystem
modifyAclEntries in class FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modified
public void removeAclEntries(Path path,
                             List<AclEntry> aclSpec)
                      throws IOException
FileSystem
removeAclEntries in class FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modified
public void removeDefaultAcl(Path path)
                      throws IOException
FileSystem
removeDefaultAcl in class FileSystempath - Path to modify
IOException - if an ACL could not be modified
public void removeAcl(Path path)
               throws IOException
FileSystem
removeAcl in class FileSystempath - Path to modify
IOException - if an ACL could not be removed
public void setAcl(Path path,
                   List<AclEntry> aclSpec)
            throws IOException
FileSystem
setAcl in class FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modified
public AclStatus getAclStatus(Path path)
                       throws IOException
FileSystem
getAclStatus in class FileSystempath - Path to get
IOException - if an ACL could not be read
public void setXAttr(Path path,
                     String name,
                     byte[] value,
                     EnumSet<XAttrSetFlag> flag)
              throws IOException
FileSystem
setXAttr in class FileSystempath - Path to modifyname - xattr name.value - xattr value.flag - xattr set flag
IOException
public byte[] getXAttr(Path path,
                       String name)
                throws IOException
FileSystem
getXAttr in class FileSystempath - Path to get extended attributename - xattr name.
IOException
public Map<String,byte[]> getXAttrs(Path path)
                             throws IOException
FileSystem
getXAttrs in class FileSystempath - Path to get extended attributes
IOException
public Map<String,byte[]> getXAttrs(Path path,
                                    List<String> names)
                             throws IOException
FileSystem
getXAttrs in class FileSystempath - Path to get extended attributesnames - XAttr names.
IOException
public List<String> listXAttrs(Path path)
                        throws IOException
FileSystem
listXAttrs in class FileSystempath - Path to get extended attributes
IOException
public void removeXAttr(Path path,
                        String name)
                 throws IOException
FileSystem
removeXAttr in class FileSystempath - Path to remove extended attributename - xattr name
IOExceptionpublic void setVerifyChecksum(boolean verifyChecksum)
FileSystem
setVerifyChecksum in class FileSystempublic long getDefaultBlockSize()
FileSystem
getDefaultBlockSize in class FileSystempublic short getDefaultReplication()
FileSystem
getDefaultReplication in class FileSystem
public FsServerDefaults getServerDefaults()
                                   throws IOException
FileSystem
getServerDefaults in class FileSystemIOExceptionpublic long getDefaultBlockSize(Path f)
FileSystem
getDefaultBlockSize in class FileSystemf - path of file
public short getDefaultReplication(Path f)
FileSystem
getDefaultReplication in class FileSystemf - of the file
public FsServerDefaults getServerDefaults(Path f)
                                   throws IOException
FileSystem
getServerDefaults in class FileSystemf - path is used to identify an FS since an FS could have
          another FS that it could be delegating the call to
IOException
public ContentSummary getContentSummary(Path f)
                                 throws IOException
FileSystemContentSummary of a given Path.
getContentSummary in class FileSystemf - path to use
IOExceptionpublic void setWriteChecksum(boolean writeChecksum)
FileSystem
setWriteChecksum in class FileSystempublic FileSystem[] getChildFileSystems()
FileSystem
public org.apache.hadoop.fs.viewfs.ViewFileSystem.MountPoint[] getMountPoints()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||