Package com.mapr.fs
Class MFS
- java.lang.Object
-
- org.apache.hadoop.fs.AbstractFileSystem
-
- com.mapr.fs.MFS
-
- All Implemented Interfaces:
org.apache.hadoop.fs.PathCapabilities
public class MFS extends org.apache.hadoop.fs.AbstractFileSystemThis class is an implementation of AbstractFileSystem, as a wrapper class around MapRFileSystem. It allows the new Yarn APIs to run on top of MapRFS.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOG
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPath(org.apache.hadoop.fs.Path path)Takes the string component of path from the first '/' and appends it to the path of the URI before calling super.checkPath(Path).org.apache.hadoop.fs.FSDataOutputStreamcreateInternal(org.apache.hadoop.fs.Path p, java.util.EnumSet<org.apache.hadoop.fs.CreateFlag> flag, org.apache.hadoop.fs.permission.FsPermission absolutePermission, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress, org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt, boolean createParent)Creates internal file with indicated permission, bufferSize, replication, blockSize etc.voidcreateSymlink(org.apache.hadoop.fs.Path target, org.apache.hadoop.fs.Path link, boolean createParent)The specification of this method matches that ofFileContext#createSymlink(Path, Path, boolean);booleandelete(org.apache.hadoop.fs.Path f, boolean recursive)org.apache.hadoop.fs.BlockLocation[]getFileBlockLocations(org.apache.hadoop.fs.Path p, long start, long len)org.apache.hadoop.fs.FileChecksumgetFileChecksum(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FileStatusgetFileStatus(org.apache.hadoop.fs.Path p)org.apache.hadoop.fs.FsStatusgetFsStatus()org.apache.hadoop.fs.FsServerDefaultsgetServerDefaults()Returns default settings for server.intgetUriDefaultPort()org.apache.hadoop.fs.FileStatus[]listStatus(org.apache.hadoop.fs.Path p)voidmkdir(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission, boolean createParent)Creates a directory at the specified path with specified permission.org.apache.hadoop.fs.FSDataInputStreamopen(org.apache.hadoop.fs.Path p, int bufferSize)voidrenameInternal(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst)voidsetOwner(org.apache.hadoop.fs.Path p, java.lang.String user, java.lang.String group)voidsetPermission(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission)booleansetReplication(org.apache.hadoop.fs.Path p, short replication)voidsetTimes(org.apache.hadoop.fs.Path p, long mtime, long atime)voidsetVerifyChecksum(boolean verifyChecksum)booleansupportsSymlinks()Returns true if the file system supports symlinks, false otherwise.-
Methods inherited from class org.apache.hadoop.fs.AbstractFileSystem
access, checkScheme, clearStatistics, create, createFileSystem, createMultipartUploader, createSnapshot, deleteSnapshot, equals, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getCanonicalServiceName, getDelegationTokens, getEnclosingRoot, getFileLinkStatus, getFsStatus, getHomeDirectory, getInitialWorkingDirectory, getLinkTarget, getServerDefaults, getStatistics, getStatistics, getStoragePolicy, getUri, getUriPath, getXAttr, getXAttrs, getXAttrs, hashCode, hasPathCapability, isValidName, listCorruptFileBlocks, listLocatedStatus, listStatusIterator, listXAttrs, makeQualified, methodNotSupported, modifyAclEntries, msync, open, openFileWithOptions, printStatistics, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameInternal, renameSnapshot, resolvePath, satisfyStoragePolicy, setAcl, setStoragePolicy, setXAttr, setXAttr, truncate, unsetStoragePolicy
-
-
-
-
Constructor Detail
-
MFS
public MFS() throws java.net.URISyntaxException, java.io.IOExceptionA no-args constructor that is required for reflection.- Throws:
java.net.URISyntaxExceptionjava.io.IOException
-
MFS
public MFS(java.net.URI uri, org.apache.hadoop.conf.Configuration conf) throws java.net.URISyntaxException, java.io.IOExceptionCalls super constructor, with parameter authorityNeeded=false and initializes maprfs with uri and conf.- Parameters:
uri- of the filesystemconf- The current configuration- Throws:
java.net.URISyntaxExceptionjava.io.IOException
-
-
Method Detail
-
createInternal
public org.apache.hadoop.fs.FSDataOutputStream createInternal(org.apache.hadoop.fs.Path p, java.util.EnumSet<org.apache.hadoop.fs.CreateFlag> flag, org.apache.hadoop.fs.permission.FsPermission absolutePermission, int bufferSize, short replication, long blockSize, org.apache.hadoop.util.Progressable progress, org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt, boolean createParent) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.FileAlreadyExistsException, java.io.FileNotFoundException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.fs.UnsupportedFileSystemException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOExceptionCreates internal file with indicated permission, bufferSize, replication, blockSize etc. Ignores checksumOpt and createParent variables.- Specified by:
createInternalin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionorg.apache.hadoop.fs.FileAlreadyExistsExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.ParentNotDirectoryExceptionorg.apache.hadoop.fs.UnsupportedFileSystemExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException- See Also:
TODO determine user of ChecksumOpt (Spencer)
-
checkPath
public void checkPath(org.apache.hadoop.fs.Path path)
Takes the string component of path from the first '/' and appends it to the path of the URI before calling super.checkPath(Path). This works around an issue where the path contains no host information causing jobs to fail.- Overrides:
checkPathin classorg.apache.hadoop.fs.AbstractFileSystem- Parameters:
path- The path to be checked TODO use only super.checkPath() instead of this modified version that manually inserts the URI (Spencer)
-
delete
public boolean delete(org.apache.hadoop.fs.Path f, boolean recursive) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
deletein classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
getFileBlockLocations
public org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.Path p, long start, long len) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
getFileBlockLocationsin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
getFileChecksum
public org.apache.hadoop.fs.FileChecksum getFileChecksum(org.apache.hadoop.fs.Path path) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
getFileChecksumin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
getFileStatus
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path p) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
getFileStatusin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
getFsStatus
public org.apache.hadoop.fs.FsStatus getFsStatus() throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, java.io.IOException- Specified by:
getFsStatusin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
getServerDefaults
public org.apache.hadoop.fs.FsServerDefaults getServerDefaults() throws java.io.IOExceptionReturns default settings for server.- Specified by:
getServerDefaultsin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
java.io.IOException
-
getUriDefaultPort
public int getUriDefaultPort()
- Specified by:
getUriDefaultPortin classorg.apache.hadoop.fs.AbstractFileSystem- Returns:
- the current port stored in URI of maprfs.
-
listStatus
public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path p) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
listStatusin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
mkdir
public void mkdir(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission, boolean createParent) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.FileAlreadyExistsException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOExceptionCreates a directory at the specified path with specified permission. Currently ignores the createParent option, maprfs will always create parents.- Specified by:
mkdirin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionorg.apache.hadoop.fs.FileAlreadyExistsExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
open
public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path p, int bufferSize) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
openin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
supportsSymlinks
public boolean supportsSymlinks()
Returns true if the file system supports symlinks, false otherwise.- Overrides:
supportsSymlinksin classorg.apache.hadoop.fs.AbstractFileSystem- Returns:
- true if filesystem supports symlinks
-
createSymlink
public void createSymlink(org.apache.hadoop.fs.Path target, org.apache.hadoop.fs.Path link, boolean createParent) throws java.io.IOException, org.apache.hadoop.fs.UnresolvedLinkExceptionThe specification of this method matches that ofFileContext#createSymlink(Path, Path, boolean);- Overrides:
createSymlinkin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
java.io.IOExceptionorg.apache.hadoop.fs.UnresolvedLinkException
-
renameInternal
public void renameInternal(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.FileAlreadyExistsException, java.io.FileNotFoundException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
renameInternalin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionorg.apache.hadoop.fs.FileAlreadyExistsExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.ParentNotDirectoryExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
setOwner
public void setOwner(org.apache.hadoop.fs.Path p, java.lang.String user, java.lang.String group) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
setOwnerin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
setPermission
public void setPermission(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.permission.FsPermission permission) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
setPermissionin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
setReplication
public boolean setReplication(org.apache.hadoop.fs.Path p, short replication) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
setReplicationin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
setTimes
public void setTimes(org.apache.hadoop.fs.Path p, long mtime, long atime) throws org.apache.hadoop.security.AccessControlException, java.io.FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, java.io.IOException- Specified by:
setTimesin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.FileNotFoundExceptionorg.apache.hadoop.fs.UnresolvedLinkExceptionjava.io.IOException
-
setVerifyChecksum
public void setVerifyChecksum(boolean verifyChecksum) throws org.apache.hadoop.security.AccessControlException, java.io.IOException- Specified by:
setVerifyChecksumin classorg.apache.hadoop.fs.AbstractFileSystem- Throws:
org.apache.hadoop.security.AccessControlExceptionjava.io.IOException
-
-