@InterfaceAudience.Public @InterfaceStability.Evolving public class ViewFs extends AbstractFileSystem
To use viewfs one would typically set the default file system in the config (i.e. fs.default.name< = viewfs:///) along with the mount table config variables as described below.
** Config variables to specify the mount table entries **
 
 The file system is initialized from the standard Hadoop config through
 config variables.
 See FsConstants for URI and Scheme constants; 
 See Constants for config var constants; 
 see ConfigUtil for convenient lib.
 
 
All the mount table config entries for view fs are prefixed by fs.viewfs.mounttable. For example the above example can be specified with the following config variables:
**** Merge Mounts **** (NOTE: merge mounts are not implemented yet.)
One can also use "MergeMounts" to merge several directories (this is sometimes called union-mounts or junction-mounts in the literature. For example of the home directories are stored on say two file systems (because they do not fit on one) then one could specify a mount entry such as following merges two dirs:
statistics| コンストラクタと説明 | 
|---|
| ViewFs(Configuration conf) | 
| 修飾子とタイプ | メソッドと説明 | 
|---|---|
| void | access(Path path,
      FsAction mode)The specification of this method matches that of
  FileContext.access(Path, FsAction)except that an UnresolvedLinkException may be thrown if a symlink is
 encountered in the path. | 
| FSDataOutputStream | createInternal(Path f,
              EnumSet<CreateFlag> flag,
              FsPermission absolutePermission,
              int bufferSize,
              short replication,
              long blockSize,
              Progressable progress,
              org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt,
              boolean createParent)The specification of this method matches that of
  AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...)except that the opts
 have been declared explicitly. | 
| Path | createSnapshot(Path path,
              String snapshotName)The specification of this method matches that of
  FileContext.createSnapshot(Path, String). | 
| void | createSymlink(Path target,
             Path link,
             boolean createParent)The specification of this method matches that of  
  FileContext.createSymlink(Path, Path, boolean); | 
| boolean | delete(Path f,
      boolean recursive)The specification of this method matches that of
  FileContext.delete(Path, boolean)except that Path f must be for
 this file system. | 
| void | deleteSnapshot(Path path,
              String snapshotName)The specification of this method matches that of
  FileContext.deleteSnapshot(Path, String). | 
| AclStatus | getAclStatus(Path path)Gets the ACLs of files and directories. | 
| List<Token<?>> | getDelegationTokens(String renewer)Get one or more delegation tokens associated with the filesystem. | 
| BlockLocation[] | getFileBlockLocations(Path f,
                     long start,
                     long len)The specification of this method matches that of
  FileContext.getFileBlockLocations(Path, long, long)except that
 Path f must be for this file system. | 
| FileChecksum | getFileChecksum(Path f)The specification of this method matches that of
  FileContext.getFileChecksum(Path)except that Path f must be for
 this file system. | 
| FileStatus | getFileLinkStatus(Path f)The specification of this method matches that of
  FileContext.getFileLinkStatus(Path)except that an UnresolvedLinkException may be thrown if a symlink is  
 encountered in the path leading up to the final path component. | 
| FileStatus | getFileStatus(Path f)The specification of this method matches that of
  FileContext.getFileStatus(Path)except that an UnresolvedLinkException may be thrown if a symlink is 
 encountered in the path. | 
| FsStatus | getFsStatus()The specification of this method matches that of
  FileContext.getFsStatus(Path). | 
| Path | getHomeDirectory()Return the current user's home directory in this file system. | 
| Path | getLinkTarget(Path f)Partially resolves the path. | 
| org.apache.hadoop.fs.viewfs.ViewFs.MountPoint[] | getMountPoints() | 
| FsServerDefaults | getServerDefaults()Return a set of server default configuration values. | 
| BlockStoragePolicySpi | getStoragePolicy(Path src)Retrieve the storage policy for a given file or directory. | 
| int | getUriDefaultPort()The default port of this file system. | 
| byte[] | getXAttr(Path path,
        String name)Get an xattr for a file or directory. | 
| Map<String,byte[]> | getXAttrs(Path path)Get all of the xattrs for a file or directory. | 
| Map<String,byte[]> | getXAttrs(Path path,
         List<String> names)Get all of the xattrs for a file or directory. | 
| boolean | isValidName(String src)Returns true if the specified string is considered valid in the path part
 of a URI by this file system. | 
| FileStatus[] | listStatus(Path f)The specification of this method matches that of
  FileContext.Util.listStatus(Path)except that Path f must be 
 for this file system. | 
| org.apache.hadoop.fs.RemoteIterator<FileStatus> | listStatusIterator(Path f)The specification of this method matches that of
  FileContext.listStatus(Path)except that Path f must be for this
 file system. | 
| List<String> | listXAttrs(Path path)Get all of the xattr names for a file or directory. | 
| void | mkdir(Path dir,
     FsPermission permission,
     boolean createParent)The specification of this method matches that of
  FileContext.mkdir(Path, FsPermission, boolean)except that the Path
 f must be fully qualified and the permission is absolute (i.e. | 
| void | modifyAclEntries(Path path,
                List<AclEntry> aclSpec)Modifies ACL entries of files and directories. | 
| FSDataInputStream | open(Path f,
    int bufferSize)The specification of this method matches that of
  FileContext.open(Path, int)except that Path f must be for this
 file system. | 
| 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. | 
| void | renameInternal(Path src,
              Path dst)The specification of this method matches that of
  FileContext.rename(Path, Path, Options.Rename...)except that Path
 f must be for this file system and NO OVERWRITE is performed. | 
| void | renameInternal(Path src,
              Path dst,
              boolean overwrite)The specification of this method matches that of
  FileContext.rename(Path, Path, Options.Rename...)except that Path
 f must be for this file system. | 
| void | renameSnapshot(Path path,
              String snapshotOldName,
              String snapshotNewName)The specification of this method matches that of
  FileContext.renameSnapshot(Path, String, String). | 
| Path | resolvePath(Path f)Return the fully-qualified path of path f resolving the path
 through any internal 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)The specification of this method matches that of
  FileContext.setOwner(Path, String, String)except that Path f must
 be for this file system. | 
| void | setPermission(Path f,
             FsPermission permission)The specification of this method matches that of
  FileContext.setPermission(Path, FsPermission)except that Path f
 must be for this file system. | 
| boolean | setReplication(Path f,
              short replication)The specification of this method matches that of
  FileContext.setReplication(Path, short)except that Path f must be
 for this file system. | 
| void | setStoragePolicy(Path path,
                String policyName)Set the storage policy for a given file or directory. | 
| void | setTimes(Path f,
        long mtime,
        long atime)The specification of this method matches that of
  FileContext.setTimes(Path, long, long)except that Path f must be
 for this file system. | 
| void | setVerifyChecksum(boolean verifyChecksum)The specification of this method matches that of
  FileContext.setVerifyChecksum(boolean, Path)except that Path f
 must be for this file system. | 
| void | setXAttr(Path path,
        String name,
        byte[] value,
        EnumSet<XAttrSetFlag> flag)Set an xattr of a file or directory. | 
| boolean | supportsSymlinks()Returns true if the file system supports symlinks, false otherwise. | 
| boolean | truncate(Path f,
        long newLength)The specification of this method matches that of
  FileContext.truncate(Path, long)except that Path f must be for
 this file system. | 
| void | unsetStoragePolicy(Path src)Unset the storage policy set for a given file or directory. | 
checkPath, checkScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getAllStoragePolicies, getCanonicalServiceName, getFsStatus, getInitialWorkingDirectory, getStatistics, getStatistics, getUri, getUriPath, hashCode, listCorruptFileBlocks, listLocatedStatus, makeQualified, open, printStatistics, rename, setXAttrpublic ViewFs(Configuration conf) throws IOException, URISyntaxException
public FsServerDefaults getServerDefaults() throws IOException
AbstractFileSystemgetServerDefaults クラス内 AbstractFileSystemIOException - an I/O error occurredpublic int getUriDefaultPort()
AbstractFileSystemgetUriDefaultPort クラス内 AbstractFileSystempublic Path getHomeDirectory()
AbstractFileSystemgetHomeDirectory クラス内 AbstractFileSystempublic Path resolvePath(Path f) throws FileNotFoundException, org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemresolvePath クラス内 AbstractFileSystemf - path to be resolvedFileNotFoundExceptionorg.apache.hadoop.security.AccessControlExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FSDataOutputStream createInternal(Path f, EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt, boolean createParent) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
 have been declared explicitly.createInternal クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileAlreadyExistsExceptionFileNotFoundExceptionParentNotDirectoryExceptionUnsupportedFileSystemExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic boolean delete(Path f, boolean recursive) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.delete(Path, boolean) except that Path f must be for
 this file system.delete クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.getFileBlockLocations(Path, long, long) except that
 Path f must be for this file system.getFileBlockLocations クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FileChecksum getFileChecksum(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.getFileChecksum(Path) except that Path f must be for
 this file system.getFileChecksum クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FileStatus getFileStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.getFileStatus(Path) 
 except that an UnresolvedLinkException may be thrown if a symlink is 
 encountered in the path.getFileStatus クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void access(Path path, FsAction mode) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.access(Path, FsAction)
 except that an UnresolvedLinkException may be thrown if a symlink is
 encountered in the path.org.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FileStatus getFileLinkStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
AbstractFileSystemFileContext.getFileLinkStatus(Path)
 except that an UnresolvedLinkException may be thrown if a symlink is  
 encountered in the path leading up to the final path component.
 If the file system does not support symlinks then the behavior is
 equivalent to AbstractFileSystem.getFileStatus(Path).getFileLinkStatus クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionUnsupportedFileSystemExceptionIOExceptionpublic FsStatus getFsStatus() throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
AbstractFileSystemFileContext.getFsStatus(Path).getFsStatus クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic org.apache.hadoop.fs.RemoteIterator<FileStatus> listStatusIterator(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.listStatus(Path) except that Path f must be for this
 file system.listStatusIterator クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FileStatus[] listStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.Util.listStatus(Path) except that Path f must be 
 for this file system.listStatus クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void mkdir(Path dir, FsPermission permission, boolean createParent) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.mkdir(Path, FsPermission, boolean) except that the Path
 f must be fully qualified and the permission is absolute (i.e. 
 umask has been applied).mkdir クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileAlreadyExistsExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic FSDataInputStream open(Path f, int bufferSize) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.open(Path, int) except that Path f must be for this
 file system.open クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic boolean truncate(Path f, long newLength) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.truncate(Path, long) except that Path f must be for
 this file system.truncate クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void renameInternal(Path src, Path dst, boolean overwrite) throws IOException, org.apache.hadoop.fs.UnresolvedLinkException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
 f must be for this file system.renameInternal クラス内 AbstractFileSystemIOExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionpublic void renameInternal(Path src, Path dst) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
 f must be for this file system and NO OVERWRITE is performed.
 
 File systems that do not have a built in overwrite need implement only this
 method and can take advantage of the default impl of the other
 AbstractFileSystem.renameInternal(Path, Path, boolean)renameInternal クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileAlreadyExistsExceptionFileNotFoundExceptionParentNotDirectoryExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic boolean supportsSymlinks()
AbstractFileSystemsupportsSymlinks クラス内 AbstractFileSystempublic void createSymlink(Path target, Path link, boolean createParent) throws IOException, org.apache.hadoop.fs.UnresolvedLinkException
AbstractFileSystemFileContext.createSymlink(Path, Path, boolean);createSymlink クラス内 AbstractFileSystemIOExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionpublic Path getLinkTarget(Path f) throws IOException
AbstractFileSystemFSLinkResolver, and differs from the similarly named method
 FileContext.getLinkTarget(Path).getLinkTarget クラス内 AbstractFileSystemIOException - subclass implementations may throw IOExceptionpublic void setOwner(Path f, String username, String groupname) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.setOwner(Path, String, String) except that Path f must
 be for this file system.setOwner クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void setPermission(Path f, FsPermission permission) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.setPermission(Path, FsPermission) except that Path f
 must be for this file system.setPermission クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic boolean setReplication(Path f, short replication) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.setReplication(Path, short) except that Path f must be
 for this file system.setReplication クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void setTimes(Path f, long mtime, long atime) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
AbstractFileSystemFileContext.setTimes(Path, long, long) except that Path f must be
 for this file system.setTimes クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionIOExceptionpublic void setVerifyChecksum(boolean verifyChecksum) throws org.apache.hadoop.security.AccessControlException, IOException
AbstractFileSystemFileContext.setVerifyChecksum(boolean, Path) except that Path f
 must be for this file system.setVerifyChecksum クラス内 AbstractFileSystemorg.apache.hadoop.security.AccessControlExceptionIOExceptionpublic org.apache.hadoop.fs.viewfs.ViewFs.MountPoint[] getMountPoints()
public List<Token<?>> getDelegationTokens(String renewer) throws IOException
AbstractFileSystemrenewer - the account name that is allowed to renew the token.IOExceptionpublic boolean isValidName(String src)
AbstractFileSystemisValidName クラス内 AbstractFileSystemsrc - String source filename to check, path part of the URIpublic void modifyAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
AbstractFileSystemmodifyAclEntries クラス内 AbstractFileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic void removeAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
AbstractFileSystemremoveAclEntries クラス内 AbstractFileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic void removeDefaultAcl(Path path) throws IOException
AbstractFileSystemremoveDefaultAcl クラス内 AbstractFileSystempath - Path to modifyIOException - if an ACL could not be modifiedpublic void removeAcl(Path path) throws IOException
AbstractFileSystemremoveAcl クラス内 AbstractFileSystempath - Path to modifyIOException - if an ACL could not be removedpublic void setAcl(Path path, List<AclEntry> aclSpec) throws IOException
AbstractFileSystemsetAcl クラス内 AbstractFileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic AclStatus getAclStatus(Path path) throws IOException
AbstractFileSystemgetAclStatus クラス内 AbstractFileSystempath - Path to getIOException - if an ACL could not be readpublic void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException
AbstractFileSystemsetXAttr クラス内 AbstractFileSystempath - Path to modifyname - xattr name.value - xattr value.flag - xattr set flagIOExceptionpublic byte[] getXAttr(Path path, String name) throws IOException
AbstractFileSystemgetXAttr クラス内 AbstractFileSystempath - Path to get extended attributename - xattr name.IOExceptionpublic Map<String,byte[]> getXAttrs(Path path) throws IOException
AbstractFileSystemgetXAttrs クラス内 AbstractFileSystempath - Path to get extended attributesIOExceptionpublic Map<String,byte[]> getXAttrs(Path path, List<String> names) throws IOException
AbstractFileSystemgetXAttrs クラス内 AbstractFileSystempath - Path to get extended attributesnames - XAttr names.IOExceptionpublic List<String> listXAttrs(Path path) throws IOException
AbstractFileSystemlistXAttrs クラス内 AbstractFileSystempath - Path to get extended attributesIOExceptionpublic void removeXAttr(Path path, String name) throws IOException
AbstractFileSystemremoveXAttr クラス内 AbstractFileSystempath - Path to remove extended attributename - xattr nameIOExceptionpublic Path createSnapshot(Path path, String snapshotName) throws IOException
AbstractFileSystemFileContext.createSnapshot(Path, String).createSnapshot クラス内 AbstractFileSystemIOExceptionpublic void renameSnapshot(Path path, String snapshotOldName, String snapshotNewName) throws IOException
AbstractFileSystemFileContext.renameSnapshot(Path, String, String).renameSnapshot クラス内 AbstractFileSystemIOExceptionpublic void deleteSnapshot(Path path, String snapshotName) throws IOException
AbstractFileSystemFileContext.deleteSnapshot(Path, String).deleteSnapshot クラス内 AbstractFileSystemIOExceptionpublic void setStoragePolicy(Path path, String policyName) throws IOException
AbstractFileSystemsetStoragePolicy クラス内 AbstractFileSystempath - file or directory path.policyName - the name of the target storage policy. The list
                   of supported Storage policies can be retrieved
                   via AbstractFileSystem.getAllStoragePolicies().IOExceptionpublic void unsetStoragePolicy(Path src) throws IOException
AbstractFileSystemunsetStoragePolicy クラス内 AbstractFileSystemsrc - file or directory path.IOExceptionpublic BlockStoragePolicySpi getStoragePolicy(Path src) throws IOException
getStoragePolicy クラス内 AbstractFileSystemsrc - file or directory path.IOExceptionCopyright © 2016 Apache Software Foundation. All rights reserved.