org.apache.hadoop.fs.viewfs
Class ViewFileSystem

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.fs.FileSystem
          extended by org.apache.hadoop.fs.viewfs.ViewFileSystem
All Implemented Interfaces:
Closeable, Configurable

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class ViewFileSystem
extends FileSystem

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 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()
           
 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.fs.FileSystem
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, createSnapshot, createSymlink, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getCanonicalUri, getDefaultPort, getDefaultUri, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getInitialWorkingDirectory, getLength, getLinkTarget, 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, renameSnapshot, resolveLink, setDefaultUri, setDefaultUri, setXAttr, startLocalOutput, supportsSymlinks
 
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

ViewFileSystem

public ViewFileSystem()
               throws IOException
This is the constructor with the signature needed by FileSystem.createFileSystem(URI, Configuration) After this constructor is called initialize() is called.

Throws:
IOException

ViewFileSystem

public ViewFileSystem(Configuration conf)
               throws IOException
Convenience Constructor for apps to call directly

Parameters:
conf -
Throws:
IOException
Method Detail

getScheme

public String getScheme()
Return the protocol scheme for the FileSystem.

Overrides:
getScheme in class FileSystem
Returns:
viewfs

initialize

public void initialize(URI theUri,
                       Configuration conf)
                throws IOException
Called after a new FileSystem instance is constructed.

Overrides:
initialize in class FileSystem
Parameters:
theUri - a uri whose authority section names the host, port, etc. for this FileSystem
conf - the configuration
Throws:
IOException

getTrashCanLocation

public Path getTrashCanLocation(Path f)
                         throws FileNotFoundException
Throws:
FileNotFoundException

getUri

public URI getUri()
Description copied from class: FileSystem
Returns a URI whose scheme and authority identify this FileSystem.

Specified by:
getUri in class FileSystem

resolvePath

public Path resolvePath(Path f)
                 throws IOException
Description copied from class: FileSystem
Return the fully-qualified path of path f resolving the path through any symlinks or mount point

Overrides:
resolvePath in class FileSystem
Parameters:
f - path to be resolved
Returns:
fully qualified path
Throws:
FileNotFoundException
IOException

getHomeDirectory

public Path getHomeDirectory()
Description copied from class: FileSystem
Return the current user's home directory in this filesystem. The default implementation returns "/user/$USER/".

Overrides:
getHomeDirectory in class FileSystem

getWorkingDirectory

public Path getWorkingDirectory()
Description copied from class: FileSystem
Get the current working directory for the given file system

Specified by:
getWorkingDirectory in class FileSystem
Returns:
the directory pathname

setWorkingDirectory

public void setWorkingDirectory(Path new_dir)
Description copied from class: FileSystem
Set the current working directory for the given file system. All relative paths will be resolved relative to it.

Specified by:
setWorkingDirectory in class FileSystem

append

public FSDataOutputStream append(Path f,
                                 int bufferSize,
                                 Progressable progress)
                          throws IOException
Description copied from class: FileSystem
Append to an existing file (optional operation).

Specified by:
append in class FileSystem
Parameters:
f - the existing file to be appended.
bufferSize - the size of the buffer to be used.
progress - for reporting progress if it is not null.
Throws:
IOException

createNonRecursive

public FSDataOutputStream createNonRecursive(Path f,
                                             FsPermission permission,
                                             EnumSet<CreateFlag> flags,
                                             int bufferSize,
                                             short replication,
                                             long blockSize,
                                             Progressable progress)
                                      throws IOException
Description copied from class: FileSystem
Opens an FSDataOutputStream at the indicated Path with write-progress reporting. Same as create(), except fails if parent directory doesn't already exist.

Overrides:
createNonRecursive in class FileSystem
Parameters:
f - the file name to open
flags - CreateFlags to use for this stream.
bufferSize - the size of the buffer to be used.
replication - required block replication for the file.
Throws:
IOException
See Also:
FileSystem.setPermission(Path, FsPermission)

create

public FSDataOutputStream create(Path f,
                                 FsPermission permission,
                                 boolean overwrite,
                                 int bufferSize,
                                 short replication,
                                 long blockSize,
                                 Progressable progress)
                          throws IOException
Description copied from class: FileSystem
Create an FSDataOutputStream at the indicated Path with write-progress reporting.

Specified by:
create in class FileSystem
Parameters:
f - the file name to open
overwrite - 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.
Throws:
IOException
See Also:
FileSystem.setPermission(Path, FsPermission)

delete

public boolean delete(Path f,
                      boolean recursive)
               throws org.apache.hadoop.security.AccessControlException,
                      FileNotFoundException,
                      IOException
Description copied from class: FileSystem
Delete a file.

Specified by:
delete in class FileSystem
Parameters:
f - 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.
Returns:
true if delete is successful else false.
Throws:
IOException
org.apache.hadoop.security.AccessControlException
FileNotFoundException

delete

public boolean delete(Path f)
               throws org.apache.hadoop.security.AccessControlException,
                      FileNotFoundException,
                      IOException
Description copied from class: FileSystem
Delete a file

Overrides:
delete in class FileSystem
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

getFileBlockLocations

public BlockLocation[] getFileBlockLocations(FileStatus fs,
                                             long start,
                                             long len)
                                      throws IOException
Description copied from class: FileSystem
Return an array containing hostnames, offset and size of portions of the given file. For a nonexistent file or regions, null will be returned. This call is most helpful with DFS, where it returns hostnames of machines that contain the given file. The FileSystem will simply return an elt containing 'localhost'.

Overrides:
getFileBlockLocations in class FileSystem
Parameters:
fs - FilesStatus to get data from
start - offset into the given file
len - length for which to get locations for
Throws:
IOException

getFileChecksum

public FileChecksum getFileChecksum(Path f)
                             throws org.apache.hadoop.security.AccessControlException,
                                    FileNotFoundException,
                                    IOException
Description copied from class: FileSystem
Get the checksum of a file.

Overrides:
getFileChecksum in class FileSystem
Parameters:
f - The file path
Returns:
The file checksum. The default return value is null, which indicates that no checksum algorithm is implemented in the corresponding FileSystem.
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

getFileStatus

public FileStatus getFileStatus(Path f)
                         throws org.apache.hadoop.security.AccessControlException,
                                FileNotFoundException,
                                IOException
Description copied from class: FileSystem
Return a file status object that represents the path.

Specified by:
getFileStatus in class FileSystem
Parameters:
f - The path we want information from
Returns:
a FileStatus object
Throws:
FileNotFoundException - when the path does not exist; IOException see specific implementation
org.apache.hadoop.security.AccessControlException
IOException

access

public void access(Path path,
                   FsAction mode)
            throws org.apache.hadoop.security.AccessControlException,
                   FileNotFoundException,
                   IOException
Description copied from class: FileSystem
Checks if the user can access a path. The mode specifies which access checks to perform. If the requested permissions are granted, then the method returns normally. If access is denied, then the method throws an AccessControlException.

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.

Parameters:
path - Path to check
mode - type of access to check
Throws:
org.apache.hadoop.security.AccessControlException - if access is denied
FileNotFoundException - if the path does not exist
IOException - see specific implementation

listStatus

public FileStatus[] listStatus(Path f)
                        throws org.apache.hadoop.security.AccessControlException,
                               FileNotFoundException,
                               IOException
Description copied from class: FileSystem
List the statuses of the files/directories in the given path if the path is a directory.

Specified by:
listStatus in class FileSystem
Parameters:
f - given path
Returns:
the statuses of the files/directories in the given patch
Throws:
FileNotFoundException - when the path does not exist; IOException see specific implementation
org.apache.hadoop.security.AccessControlException
IOException

mkdirs

public boolean mkdirs(Path dir,
                      FsPermission permission)
               throws IOException
Description copied from class: FileSystem
Make the given file and all non-existent parents into directories. Has the semantics of Unix 'mkdir -p'. Existence of the directory hierarchy is not an error.

Specified by:
mkdirs in class FileSystem
Parameters:
dir - path to create
permission - to apply to f
Throws:
IOException

open

public FSDataInputStream open(Path f,
                              int bufferSize)
                       throws org.apache.hadoop.security.AccessControlException,
                              FileNotFoundException,
                              IOException
Description copied from class: FileSystem
Opens an FSDataInputStream at the indicated Path.

Specified by:
open in class FileSystem
Parameters:
f - the file name to open
bufferSize - the size of the buffer to be used.
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

rename

public boolean rename(Path src,
                      Path dst)
               throws IOException
Description copied from class: FileSystem
Renames Path src to Path dst. Can take place on local fs or remote DFS.

Specified by:
rename in class FileSystem
Parameters:
src - path to be renamed
dst - new path after rename
Returns:
true if rename is successful
Throws:
IOException - on failure

setOwner

public void setOwner(Path f,
                     String username,
                     String groupname)
              throws org.apache.hadoop.security.AccessControlException,
                     FileNotFoundException,
                     IOException
Description copied from class: FileSystem
Set owner of a path (i.e. a file or a directory). The parameters username and groupname cannot both be null.

Overrides:
setOwner in class FileSystem
Parameters:
f - The path
username - If it is null, the original username remains unchanged.
groupname - If it is null, the original groupname remains unchanged.
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

setPermission

public void setPermission(Path f,
                          FsPermission permission)
                   throws org.apache.hadoop.security.AccessControlException,
                          FileNotFoundException,
                          IOException
Description copied from class: FileSystem
Set permission of a path.

Overrides:
setPermission in class FileSystem
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

setReplication

public boolean setReplication(Path f,
                              short replication)
                       throws org.apache.hadoop.security.AccessControlException,
                              FileNotFoundException,
                              IOException
Description copied from class: FileSystem
Set replication for an existing file.

Overrides:
setReplication in class FileSystem
Parameters:
f - file name
replication - new replication
Returns:
true if successful; false if file does not exist or is a directory
Throws:
IOException
org.apache.hadoop.security.AccessControlException
FileNotFoundException

setTimes

public void setTimes(Path f,
                     long mtime,
                     long atime)
              throws org.apache.hadoop.security.AccessControlException,
                     FileNotFoundException,
                     IOException
Description copied from class: FileSystem
Set access time of a file

Overrides:
setTimes in class FileSystem
Parameters:
f - The path
mtime - 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.
Throws:
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException

modifyAclEntries

public void modifyAclEntries(Path path,
                             List<AclEntry> aclSpec)
                      throws IOException
Description copied from class: FileSystem
Modifies ACL entries of files and directories. This method can add new ACL entries or modify the permissions on existing ACL entries. All existing ACL entries that are not specified in this call are retained without changes. (Modifications are merged into the current ACL.)

Overrides:
modifyAclEntries in class FileSystem
Parameters:
path - Path to modify
aclSpec - List describing modifications
Throws:
IOException - if an ACL could not be modified

removeAclEntries

public void removeAclEntries(Path path,
                             List<AclEntry> aclSpec)
                      throws IOException
Description copied from class: FileSystem
Removes ACL entries from files and directories. Other ACL entries are retained.

Overrides:
removeAclEntries in class FileSystem
Parameters:
path - Path to modify
aclSpec - List describing entries to remove
Throws:
IOException - if an ACL could not be modified

removeDefaultAcl

public void removeDefaultAcl(Path path)
                      throws IOException
Description copied from class: FileSystem
Removes all default ACL entries from files and directories.

Overrides:
removeDefaultAcl in class FileSystem
Parameters:
path - Path to modify
Throws:
IOException - if an ACL could not be modified

removeAcl

public void removeAcl(Path path)
               throws IOException
Description copied from class: FileSystem
Removes all but the base ACL entries of files and directories. The entries for user, group, and others are retained for compatibility with permission bits.

Overrides:
removeAcl in class FileSystem
Parameters:
path - Path to modify
Throws:
IOException - if an ACL could not be removed

setAcl

public void setAcl(Path path,
                   List<AclEntry> aclSpec)
            throws IOException
Description copied from class: FileSystem
Fully replaces ACL of files and directories, discarding all existing entries.

Overrides:
setAcl in class FileSystem
Parameters:
path - Path to modify
aclSpec - List describing modifications, must include entries for user, group, and others for compatibility with permission bits.
Throws:
IOException - if an ACL could not be modified

getAclStatus

public AclStatus getAclStatus(Path path)
                       throws IOException
Description copied from class: FileSystem
Gets the ACL of a file or directory.

Overrides:
getAclStatus in class FileSystem
Parameters:
path - Path to get
Returns:
AclStatus describing the ACL of the file or directory
Throws:
IOException - if an ACL could not be read

setXAttr

public void setXAttr(Path path,
                     String name,
                     byte[] value,
                     EnumSet<XAttrSetFlag> flag)
              throws IOException
Description copied from class: FileSystem
Set an xattr of a file or directory. The name must be prefixed with the namespace followed by ".". For example, "user.attr".

Refer to the HDFS extended attributes user documentation for details.

Overrides:
setXAttr in class FileSystem
Parameters:
path - Path to modify
name - xattr name.
value - xattr value.
flag - xattr set flag
Throws:
IOException

getXAttr

public byte[] getXAttr(Path path,
                       String name)
                throws IOException
Description copied from class: FileSystem
Get an xattr name and value for a file or directory. The name must be prefixed with the namespace followed by ".". For example, "user.attr".

Refer to the HDFS extended attributes user documentation for details.

Overrides:
getXAttr in class FileSystem
Parameters:
path - Path to get extended attribute
name - xattr name.
Returns:
byte[] xattr value.
Throws:
IOException

getXAttrs

public Map<String,byte[]> getXAttrs(Path path)
                             throws IOException
Description copied from class: FileSystem
Get all of the xattr name/value pairs for a file or directory. Only those xattrs which the logged-in user has permissions to view are returned.

Refer to the HDFS extended attributes user documentation for details.

Overrides:
getXAttrs in class FileSystem
Parameters:
path - Path to get extended attributes
Returns:
Map describing the XAttrs of the file or directory
Throws:
IOException

getXAttrs

public Map<String,byte[]> getXAttrs(Path path,
                                    List<String> names)
                             throws IOException
Description copied from class: FileSystem
Get all of the xattrs name/value pairs for a file or directory. Only those xattrs which the logged-in user has permissions to view are returned.

Refer to the HDFS extended attributes user documentation for details.

Overrides:
getXAttrs in class FileSystem
Parameters:
path - Path to get extended attributes
names - XAttr names.
Returns:
Map describing the XAttrs of the file or directory
Throws:
IOException

listXAttrs

public List<String> listXAttrs(Path path)
                        throws IOException
Description copied from class: FileSystem
Get all of the xattr names for a file or directory. Only those xattr names which the logged-in user has permissions to view are returned.

Refer to the HDFS extended attributes user documentation for details.

Overrides:
listXAttrs in class FileSystem
Parameters:
path - Path to get extended attributes
Returns:
List of the XAttr names of the file or directory
Throws:
IOException

removeXAttr

public void removeXAttr(Path path,
                        String name)
                 throws IOException
Description copied from class: FileSystem
Remove an xattr of a file or directory. The name must be prefixed with the namespace followed by ".". For example, "user.attr".

Refer to the HDFS extended attributes user documentation for details.

Overrides:
removeXAttr in class FileSystem
Parameters:
path - Path to remove extended attribute
name - xattr name
Throws:
IOException

setVerifyChecksum

public void setVerifyChecksum(boolean verifyChecksum)
Description copied from class: FileSystem
Set the verify checksum flag. This is only applicable if the corresponding FileSystem supports checksum. By default doesn't do anything.

Overrides:
setVerifyChecksum in class FileSystem

getDefaultBlockSize

public long getDefaultBlockSize()
Description copied from class: FileSystem
Return the number of bytes that large input files should be optimally be split into to minimize i/o time.

Overrides:
getDefaultBlockSize in class FileSystem

getDefaultReplication

public short getDefaultReplication()
Description copied from class: FileSystem
Get the default replication.

Overrides:
getDefaultReplication in class FileSystem

getServerDefaults

public FsServerDefaults getServerDefaults()
                                   throws IOException
Description copied from class: FileSystem
Return a set of server default configuration values

Overrides:
getServerDefaults in class FileSystem
Returns:
server default configuration values
Throws:
IOException

getDefaultBlockSize

public long getDefaultBlockSize(Path f)
Description copied from class: FileSystem
Return the number of bytes that large input files should be optimally be split into to minimize i/o time. The given path will be used to locate the actual filesystem. The full path does not have to exist.

Overrides:
getDefaultBlockSize in class FileSystem
Parameters:
f - path of file
Returns:
the default block size for the path's filesystem

getDefaultReplication

public short getDefaultReplication(Path f)
Description copied from class: FileSystem
Get the default replication for a path. The given path will be used to locate the actual filesystem. The full path does not have to exist.

Overrides:
getDefaultReplication in class FileSystem
Parameters:
f - of the file
Returns:
default replication for the path's filesystem

getServerDefaults

public FsServerDefaults getServerDefaults(Path f)
                                   throws IOException
Description copied from class: FileSystem
Return a set of server default configuration values

Overrides:
getServerDefaults in class FileSystem
Parameters:
f - path is used to identify an FS since an FS could have another FS that it could be delegating the call to
Returns:
server default configuration values
Throws:
IOException

getContentSummary

public ContentSummary getContentSummary(Path f)
                                 throws IOException
Description copied from class: FileSystem
Return the ContentSummary of a given Path.

Overrides:
getContentSummary in class FileSystem
Parameters:
f - path to use
Throws:
IOException

setWriteChecksum

public void setWriteChecksum(boolean writeChecksum)
Description copied from class: FileSystem
Set the write checksum flag. This is only applicable if the corresponding FileSystem supports checksum. By default doesn't do anything.

Overrides:
setWriteChecksum in class FileSystem

getChildFileSystems

public FileSystem[] getChildFileSystems()
Description copied from class: FileSystem
Get all the immediate child FileSystems embedded in this FileSystem. It does not recurse and get grand children. If a FileSystem has multiple child FileSystems, then it should return a unique list of those FileSystems. Default is to return null to signify no children.

Returns:
FileSystems used by this FileSystem

getMountPoints

public org.apache.hadoop.fs.viewfs.ViewFileSystem.MountPoint[] getMountPoints()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.