1. Hadoop 抽象文件系统
publicabstractclassFileSystemextendsConfiguredimplementsCloseable{
}
addFileSystemForTesting(URI,Configuration, FileSystem)
clearStatistics()
closeAll()
closeAllForUGI(UserGroupInformation)
create(FileSystem, Path,FsPermission)
createFileSystem(URI,Configuration)
fixName(String)
get(Configuration)
get(URI,Configuration)
get(URI,Configuration, String)
getAllStatistics()
getDefaultUri(Configuration)
getLocal(Configuration)
getNamed(String,Configuration)
getStatistics()
getStatistics(String,Class<?extends FileSystem>)
mkdirs(FileSystem, Path,FsPermission)
printStatistics()
setDefaultUri(Configuration,String)
setDefaultUri(Configuration,URI)
deleteOnExit :Set<Path>
key :Key
statistics :Statistics
FileSystem()
append(Path)
append(Path,int)
append(Path,int, Progressable)
checkPath(Path)
close()
completeLocalOutput(Path,Path)
copyFromLocalFile(boolean,boolean, Path, Path)
copyFromLocalFile(boolean,boolean, Path[], Path)
copyFromLocalFile(boolean,Path, Path)
copyFromLocalFile(Path,Path)
copyToLocalFile(boolean,Path, Path)
copyToLocalFile(Path,Path)
create(Path)
create(Path,boolean)
create(Path,boolean, int)
create(Path,boolean, int, Progressable)
create(Path,boolean, int, short, long)
create(Path,boolean, int, short, long, Progressable)
create(Path,FsPermission, boolean, int, short, long, Progressable)
create(Path,Progressable)
create(Path,short)
create(Path,short, Progressable)
createNewFile(Path)
createNonRecursive(Path,boolean, int, short, long, Progressable)
createNonRecursive(Path,FsPermission, boolean, int, short, long, Progressable)
delete(Path)
delete(Path,boolean)
deleteOnExit(Path)
exists(Path)
getBlockSize(Path)
getCanonicalServiceName()
getCanonicalUri()
getContentSummary(Path)
getDefaultBlockSize()
getDefaultPort()
getDefaultReplication()
getDelegationToken(String)
getFileBlockLocations(FileStatus,long, long)
getFileChecksum(Path)
getFileStatus(Path)
getFileStatus(Path[])
getHomeDirectory()
getLength(Path)
getName()
getReplication(Path)
getUri()
getUsed()
getWorkingDirectory()
globPathsLevel(Path[],String[], int, boolean[])
globStatus(Path)
globStatus(Path,PathFilter)
globStatusInternal(Path,PathFilter)
initialize(URI,Configuration)
isDirectory(Path)
isFile(Path)
listStatus(ArrayList<FileStatus>,Path, PathFilter)
listStatus(Path)
listStatus(Path,PathFilter)
listStatus(Path[])
listStatus(Path[],PathFilter)
makeQualified(Path)
mkdirs(Path)
mkdirs(Path,FsPermission)
moveFromLocalFile(Path,Path)
moveFromLocalFile(Path[],Path)
moveToLocalFile(Path,Path)
open(Path)
open(Path,int)
processDeleteOnExit()
rename(Path,Path)
setOwner(Path,String, String)
setPermission(Path,FsPermission)
setReplication(Path,short)
setTimes(Path,long, long)
setVerifyChecksum(boolean)
setWorkingDirectory(Path)
startLocalOutput(Path,Path)
}
2. 文件状态类
publicclassFileStatusimplementsWritable,Comparable {
}
文件权限org.apache.hadoop.fs.FsPermission
public class FsPermissionimplements Writable{
}
publicenumFsAction{
}
资源使用概要 (相当于du、df命令)
publicclassContentSummaryimplementsWritable{
}
3.文件输入输出流
publicabstractclassFSInputStreamextendsInputStream
getPos()
read(long,byte[], int, int)
readFully(long,byte[])
readFully(long,byte[], int, int)
seek(long)
seekToNewSource(long)
}
publicclassFSDataInputStreamextendsDataInputStream
getPos()
read(long,byte[], int, int)
readFully(long,byte[])
readFully(long,byte[], int, int)
seek(long)
seekToNewSource(long)
}
public class FSDataOutputStreamextends DataOutputStreamimplementsSyncable{
close()
getPos()
getWrappedStream()
sync()
}
4.FileSystem打开文件系统
staticclassCache{
5.本地文件系统org.apache.hadoop.fs.RawLocalFileSystem
publicclassRawLocalFileSystemextendsFileSystem{
append(Path,int, Progressable)
close()
completeLocalOutput(Path,Path)
create(Path,boolean, boolean, int, short, long, Progressable)
create(Path,boolean, int, short, long, Progressable)
create(Path,FsPermission, boolean, int, short, long, Progressable)
createNonRecursive(Path,FsPermission, boolean, int, short, long, Progressable)
delete(Path)
delete(Path,boolean)
getFileStatus(Path)
getHomeDirectory()
getUri()
getWorkingDirectory()
initialize(URI,Configuration)
listStatus(Path)
makeAbsolute(Path)
mkdirs(Path)
mkdirs(Path,FsPermission)
moveFromLocalFile(Path,Path)
open(Path,int)
pathToFile(Path)
rename(Path,Path)
setOwner(Path,String, String)
setPermission(Path,FsPermission)
setWorkingDirectory(Path)
startLocalOutput(Path,Path)
toString()
}
6.带检验和的文件系统org.apache.hadoop.fs.ChecksumFileSystem
publicabstractclassChecksumFileSystemextendsFilterFileSystem{
}
getApproxChkSumLength(long)
getChecksumLength(long,int)
isChecksumFile(Path)
append(Path,int, Progressable)
completeLocalOutput(Path,Path)
copyFromLocalFile(boolean,Path, Path)
copyToLocalFile(boolean,Path, Path)
copyToLocalFile(Path,Path, boolean)
create(Path,FsPermission, boolean, boolean, int, short, long,Progressable)
create(Path,FsPermission, boolean, int, short, long, Progressable)
createNonRecursive(Path,FsPermission, boolean, int, short, long, Progressable)
delete(Path,boolean)
getBytesPerSum()
getChecksumFile(Path)
getChecksumFileLength(Path,long)
getRawFileSystem()
getSumBufferSize(int,int)
listStatus(Path)
mkdirs(Path)
open(Path,int)
rename(Path,Path)
reportChecksumFailure(Path,FSDataInputStream, long, FSDataInputStream, long)
setConf(Configuration)
setReplication(Path,short)
setVerifyChecksum(boolean)
startLocalOutput(Path,Path)
}
其中
abstractpublicclassFSInputCheckerextendsFSInputStream{
available()
fill()
getChecksum()
getChunkPosition(long)
getPos()
mark(int)
markSupported()
needChecksum()
read()
read(byte[],int, int)
read1(byte[],int, int)
readChecksumChunk(byte[],int, int)
readChunk(long,byte[], int, int, byte[])
reset()
resetState()
seek(long)
set(boolean,Checksum, int, int)
skip(long)
verifySum(long)
}
abstractpublicclassFSOutputSummerextendsOutputStream{
convertToByteStream(Checksum,int)
int2byte(int,byte[])
flushBuffer()
flushBuffer(boolean)
resetChecksumChunk(int)
write(byte[],int, int)
write(int)
write1(byte[],int, int)
writeChecksumChunk(byte[],int, int, boolean)
writeChunk(byte[],int, int, byte[])
}
7.用于测试的内存文件系统InMemoryFileSystem
publicclassInMemoryFileSystemextendsChecksumFileSystem{
}