@InterfaceAudience.Public @InterfaceStability.Evolving public class ViewFileSystem extends FileSystem
ViewFs.DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX| コンストラクタと説明 | 
|---|
| 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 | 
| 修飾子とタイプ | メソッドと説明 | 
|---|---|
| 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. | 
| Path | createSnapshot(Path path,
              String snapshotName)Create a snapshot | 
| boolean | delete(Path f)Delete a file | 
| boolean | delete(Path f,
      boolean recursive)Delete a file. | 
| void | deleteSnapshot(Path path,
              String snapshotName)Delete a snapshot of a directory | 
| AclStatus | getAclStatus(Path path)Gets the ACL of a file or directory. | 
| Collection<? extends BlockStoragePolicySpi> | getAllStoragePolicies()Retrieve all the storage policies supported by this file system. | 
| 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() | 
| QuotaUsage | getQuotaUsage(Path f)Return the  QuotaUsageof a givenPath. | 
| 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 | 
| BlockStoragePolicySpi | getStoragePolicy(Path src)Query the effective storage policy ID for the given file or directory. | 
| 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. | 
| org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> | listLocatedStatus(Path f,
                 PathFilter filter)Listing a directory
 The returned results include its block location if it is a file
 The results are filtered by the given path filter | 
| 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. | 
| void | renameSnapshot(Path path,
              String snapshotOldName,
              String snapshotNewName)Rename a snapshot | 
| 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. a file or a directory). | 
| void | setPermission(Path f,
             FsPermission permission)Set permission of a path. | 
| boolean | setReplication(Path f,
              short replication)Set replication for an existing file. | 
| void | setStoragePolicy(Path src,
                String policyName)Set the storage policy for a given file or directory. | 
| 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. | 
| boolean | truncate(Path f,
        long newLength)Truncate the file in the indicated path to the indicated size. | 
| void | unsetStoragePolicy(Path src)Unset the storage policy set for a given file or directory. | 
append, append, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, createSnapshot, createSymlink, deleteOnExit, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getCanonicalUri, getDefaultPort, getDefaultUri, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getReplication, getStatistics, getStatistics, getStatus, getStatus, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listStatus, listStatus, listStatus, listStatusIterator, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, rename, resolveLink, setDefaultUri, setDefaultUri, setXAttr, startLocalOutput, supportsSymlinksgetConf, setConfpublic ViewFileSystem() throws IOException
FileSystem.createFileSystem(URI, Configuration)
 
 After this constructor is called initialize() is called.IOExceptionpublic ViewFileSystem(Configuration conf) throws IOException
conf - IOExceptionpublic String getScheme()
getScheme クラス内 FileSystemviewfspublic void initialize(URI theUri, Configuration conf) throws IOException
initialize クラス内 FileSystemtheUri - a uri whose authority section names the host, port, etc. for
          this FileSystemconf - the configurationIOExceptionpublic Path getTrashCanLocation(Path f) throws FileNotFoundException
public URI getUri()
FileSystemgetUri クラス内 FileSystempublic Path resolvePath(Path f) throws IOException
FileSystemresolvePath クラス内 FileSystemf - path to be resolvedFileNotFoundExceptionIOExceptionpublic Path getHomeDirectory()
FileSystemgetHomeDirectory クラス内 FileSystempublic Path getWorkingDirectory()
FileSystemgetWorkingDirectory クラス内 FileSystempublic void setWorkingDirectory(Path new_dir)
FileSystemsetWorkingDirectory クラス内 FileSystemnew_dir - Path of new working directorypublic FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
FileSystemappend クラス内 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 createNonRecursive(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystemcreateNonRecursive クラス内 FileSystemf - the file name to openpermission - file permissionflags - CreateFlags to use for this stream.bufferSize - the size of the buffer to be used.replication - required block replication for the file.blockSize - block sizeprogress - the progress reporterIOExceptionFileSystem.setPermission(Path, FsPermission)public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystemcreate クラス内 FileSystemf - the file name to openpermission - file permissionoverwrite - 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.blockSize - block sizeprogress - the progress reporterIOExceptionFileSystem.setPermission(Path, FsPermission)public boolean delete(Path f, boolean recursive) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemdelete クラス内 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 クラス内 FileSystemorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic BlockLocation[] getFileBlockLocations(FileStatus fs, long start, long len) throws IOException
FileSystemgetFileBlockLocations クラス内 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 クラス内 FileSystemf - The file pathorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic FileStatus getFileStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemgetFileStatus クラス内 FileSystemf - The path we want information fromFileNotFoundException - when the path does not exist;
         IOException see specific implementationorg.apache.hadoop.security.AccessControlExceptionIOExceptionpublic 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 checkorg.apache.hadoop.security.AccessControlException - if access is deniedFileNotFoundException - if the path does not existIOException - see specific implementationpublic FileStatus[] listStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemDoes not guarantee to return the List of files/directories status in a sorted order.
listStatus クラス内 FileSystemf - given pathFileNotFoundException - when the path does not exist;
         IOException see specific implementationorg.apache.hadoop.security.AccessControlExceptionIOExceptionpublic org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f, PathFilter filter) throws FileNotFoundException, IOException
FileSystemlistLocatedStatus クラス内 FileSystemf - a pathfilter - a path filterFileNotFoundException - if f does not existIOException - if any I/O error occurredpublic boolean mkdirs(Path dir, FsPermission permission) throws IOException
FileSystemmkdirs クラス内 FileSystemdir - path to createpermission - to apply to fIOExceptionpublic FSDataInputStream open(Path f, int bufferSize) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemopen クラス内 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 クラス内 FileSystemsrc - path to be renameddst - new path after renameIOException - on failurepublic boolean truncate(Path f, long newLength) throws IOException
FileSystemtruncate クラス内 FileSystemf - The path to the file to be truncatednewLength - The size the file is to be truncated totrue if the file has been truncated to the desired
 newLength and is immediately available to be reused for
 write operations such as append, or
 false if a background process of adjusting the length of
 the last block has been started, and clients should wait for it to
 complete before proceeding with further file updates.IOExceptionpublic void setOwner(Path f, String username, String groupname) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetOwner クラス内 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 クラス内 FileSystemf - The pathpermission - permissionorg.apache.hadoop.security.AccessControlExceptionFileNotFoundExceptionIOExceptionpublic boolean setReplication(Path f, short replication) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystemsetReplication クラス内 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 クラス内 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 modifyAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
FileSystemmodifyAclEntries クラス内 FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic void removeAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
FileSystemremoveAclEntries クラス内 FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic void removeDefaultAcl(Path path) throws IOException
FileSystemremoveDefaultAcl クラス内 FileSystempath - Path to modifyIOException - if an ACL could not be modifiedpublic void removeAcl(Path path) throws IOException
FileSystemremoveAcl クラス内 FileSystempath - Path to modifyIOException - if an ACL could not be removedpublic void setAcl(Path path, List<AclEntry> aclSpec) throws IOException
FileSystemsetAcl クラス内 FileSystempath - Path to modifyaclSpec - ListIOException - if an ACL could not be modifiedpublic AclStatus getAclStatus(Path path) throws IOException
FileSystemgetAclStatus クラス内 FileSystempath - Path to getIOException - if an ACL could not be readpublic void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException
FileSystemsetXAttr クラス内 FileSystempath - Path to modifyname - xattr name.value - xattr value.flag - xattr set flagIOExceptionpublic byte[] getXAttr(Path path, String name) throws IOException
FileSystemgetXAttr クラス内 FileSystempath - Path to get extended attributename - xattr name.IOExceptionpublic Map<String,byte[]> getXAttrs(Path path) throws IOException
FileSystemgetXAttrs クラス内 FileSystempath - Path to get extended attributesIOExceptionpublic Map<String,byte[]> getXAttrs(Path path, List<String> names) throws IOException
FileSystemgetXAttrs クラス内 FileSystempath - Path to get extended attributesnames - XAttr names.IOExceptionpublic List<String> listXAttrs(Path path) throws IOException
FileSystemlistXAttrs クラス内 FileSystempath - Path to get extended attributesIOExceptionpublic void removeXAttr(Path path, String name) throws IOException
FileSystemremoveXAttr クラス内 FileSystempath - Path to remove extended attributename - xattr nameIOExceptionpublic void setVerifyChecksum(boolean verifyChecksum)
FileSystemsetVerifyChecksum クラス内 FileSystemverifyChecksum - Verify checksum flagpublic long getDefaultBlockSize()
FileSystemgetDefaultBlockSize クラス内 FileSystempublic short getDefaultReplication()
FileSystemgetDefaultReplication クラス内 FileSystempublic FsServerDefaults getServerDefaults() throws IOException
FileSystemgetServerDefaults クラス内 FileSystemIOExceptionpublic long getDefaultBlockSize(Path f)
FileSystemgetDefaultBlockSize クラス内 FileSystemf - path of filepublic short getDefaultReplication(Path f)
FileSystemgetDefaultReplication クラス内 FileSystemf - of the filepublic FsServerDefaults getServerDefaults(Path f) throws IOException
FileSystemgetServerDefaults クラス内 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 クラス内 FileSystemf - path to useIOExceptionpublic QuotaUsage getQuotaUsage(Path f) throws IOException
FileSystemQuotaUsage of a given Path.getQuotaUsage クラス内 FileSystemf - path to useIOExceptionpublic void setWriteChecksum(boolean writeChecksum)
FileSystemsetWriteChecksum クラス内 FileSystemwriteChecksum - Write checsum flagpublic FileSystem[] getChildFileSystems()
FileSystempublic org.apache.hadoop.fs.viewfs.ViewFileSystem.MountPoint[] getMountPoints()
public Path createSnapshot(Path path, String snapshotName) throws IOException
FileSystemcreateSnapshot クラス内 FileSystempath - The directory where snapshots will be taken.snapshotName - The name of the snapshotIOExceptionpublic void renameSnapshot(Path path, String snapshotOldName, String snapshotNewName) throws IOException
FileSystemrenameSnapshot クラス内 FileSystempath - The directory path where the snapshot was takensnapshotOldName - Old name of the snapshotsnapshotNewName - New name of the snapshotIOExceptionpublic void deleteSnapshot(Path path, String snapshotName) throws IOException
FileSystemdeleteSnapshot クラス内 FileSystempath - The directory that the to-be-deleted snapshot belongs tosnapshotName - The name of the snapshotIOExceptionpublic void setStoragePolicy(Path src, String policyName) throws IOException
FileSystemsetStoragePolicy クラス内 FileSystemsrc - file or directory path.policyName - the name of the target storage policy. The list
                   of supported Storage policies can be retrieved
                   via FileSystem.getAllStoragePolicies().IOExceptionpublic void unsetStoragePolicy(Path src) throws IOException
FileSystemunsetStoragePolicy クラス内 FileSystemsrc - file or directory path.IOExceptionpublic BlockStoragePolicySpi getStoragePolicy(Path src) throws IOException
FileSystemgetStoragePolicy クラス内 FileSystemsrc - file or directory path.IOExceptionpublic Collection<? extends BlockStoragePolicySpi> getAllStoragePolicies() throws IOException
FileSystemgetAllStoragePolicies クラス内 FileSystemIOExceptionCopyright © 2016 Apache Software Foundation. All rights reserved.