|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.conf.Configured org.apache.hadoop.fs.FileSystem org.apache.hadoop.dfs.DistributedFileSystem
public class DistributedFileSystem
Implementation of the abstract FileSystem for the DFS system. This object is the way end-user code interacts with a Hadoop DistributedFileSystem.
Nested Class Summary | |
---|---|
static class |
DistributedFileSystem.DiskStatus
|
Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem |
---|
FileSystem.Statistics |
Field Summary |
---|
Fields inherited from class org.apache.hadoop.fs.FileSystem |
---|
LOG, statistics |
Constructor Summary | |
---|---|
DistributedFileSystem()
|
|
DistributedFileSystem(InetSocketAddress namenode,
Configuration conf)
Deprecated. |
Method Summary | |
---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
This optional operation is not yet supported. |
protected void |
checkPath(Path path)
Permit paths which explicitly specify the default port. |
void |
close()
No more filesystem operations are needed. |
FSDataOutputStream |
create(Path f,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress reporting. |
boolean |
delete(Path f)
Deprecated. |
boolean |
delete(Path f,
boolean recursive)
requires a boolean check to delete a non empty directory recursively. |
UpgradeStatusReport |
distributedUpgradeProgress(FSConstants.UpgradeAction action)
|
void |
finalizeUpgrade()
Finalize previously upgraded files system state. |
ContentSummary |
getContentSummary(Path f)
Return the ContentSummary of a given Path . |
DatanodeInfo[] |
getDataNodeStats()
Return statistics for each datanode. |
long |
getDefaultBlockSize()
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. |
DistributedFileSystem.DiskStatus |
getDiskStatus()
Return the disk usage of the filesystem, including total capacity, used space, and remaining space |
BlockLocation[] |
getFileBlockLocations(FileStatus file,
long start,
long len)
Return an array containing hostnames, offset and size of portions of the given file. |
FileStatus |
getFileStatus(Path f)
Returns the stat information about the file. |
Path |
getHomeDirectory()
Return the current user's home directory in this filesystem. |
String |
getName()
Deprecated. |
long |
getRawCapacity()
Return the total raw capacity of the filesystem, disregarding replication . |
long |
getRawUsed()
Return the total raw used space in the filesystem, disregarding replication . |
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem. |
Path |
getWorkingDirectory()
Get the current working directory for the given file system |
void |
initialize(URI uri,
Configuration conf)
Called after a new FileSystem instance is constructed. |
FileStatus[] |
listStatus(Path p)
List the statuses of the files/directories in the given path if the path is a directory. |
void |
metaSave(String pathname)
|
boolean |
mkdirs(Path f,
FsPermission permission)
Make the given file and all non-existent parents into directories. |
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path. |
void |
refreshNodes()
|
boolean |
rename(Path src,
Path dst)
Rename files/dirs |
boolean |
reportChecksumFailure(Path f,
FSDataInputStream in,
long inPos,
FSDataInputStream sums,
long sumsPos)
We need to find the blocks that didn't match. |
void |
setOwner(Path p,
String username,
String groupname)
Set owner of a path (i.e. |
void |
setPermission(Path p,
FsPermission permission)
Set permission of a path. |
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file. |
boolean |
setSafeMode(FSConstants.SafeModeAction action)
Enter, leave or get safe mode. |
void |
setVerifyChecksum(boolean verifyChecksum)
|
void |
setWorkingDirectory(Path dir)
Set the current working directory for the given file system. |
String |
toString()
|
Methods inherited from class org.apache.hadoop.fs.FileSystem |
---|
append, append, closeAll, completeLocalOutput, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, deleteOnExit, exists, get, get, getBlockSize, getDefaultUri, getFileBlockLocations, getLength, getLocal, getNamed, getReplication, getStatistics, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, open, parseArgs, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, startLocalOutput |
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, wait, wait, wait |
Constructor Detail |
---|
public DistributedFileSystem()
public DistributedFileSystem(InetSocketAddress namenode, Configuration conf) throws IOException
IOException
Method Detail |
---|
public String getName()
getName
in class FileSystem
public URI getUri()
FileSystem
getUri
in class FileSystem
public void initialize(URI uri, Configuration conf) throws IOException
FileSystem
initialize
in class FileSystem
uri
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configuration
IOException
protected void checkPath(Path path)
checkPath
in class FileSystem
public Path getWorkingDirectory()
FileSystem
getWorkingDirectory
in class FileSystem
public long getDefaultBlockSize()
FileSystem
getDefaultBlockSize
in class FileSystem
public short getDefaultReplication()
FileSystem
getDefaultReplication
in class FileSystem
public void setWorkingDirectory(Path dir)
FileSystem
setWorkingDirectory
in class FileSystem
public Path getHomeDirectory()
getHomeDirectory
in class FileSystem
public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException
FileSystem
getFileBlockLocations
in class FileSystem
IOException
public void setVerifyChecksum(boolean verifyChecksum)
public FSDataInputStream open(Path f, int bufferSize) throws IOException
FileSystem
open
in class FileSystem
f
- the file name to openbufferSize
- the size of the buffer to be used.
IOException
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
append
in class FileSystem
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.
IOException
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystem
create
in class FileSystem
f
- the file name to openoverwrite
- 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.
IOException
FileSystem.setPermission(Path, FsPermission)
public boolean setReplication(Path src, short replication) throws IOException
FileSystem
setReplication
in class FileSystem
src
- file namereplication
- new replication
IOException
public boolean rename(Path src, Path dst) throws IOException
rename
in class FileSystem
IOException
@Deprecated public boolean delete(Path f) throws IOException
delete
in class FileSystem
IOException
public boolean delete(Path f, boolean recursive) throws IOException
delete
in class FileSystem
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.
IOException
public ContentSummary getContentSummary(Path f) throws IOException
ContentSummary
of a given Path
.
getContentSummary
in class FileSystem
IOException
public FileStatus[] listStatus(Path p) throws IOException
FileSystem
listStatus
in class FileSystem
p
- given path
IOException
public boolean mkdirs(Path f, FsPermission permission) throws IOException
FileSystem
mkdirs
in class FileSystem
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FileSystem
IOException
public String toString()
toString
in class Object
public DistributedFileSystem.DiskStatus getDiskStatus() throws IOException
IOException
public long getRawCapacity() throws IOException
IOException
public long getRawUsed() throws IOException
IOException
public DatanodeInfo[] getDataNodeStats() throws IOException
IOException
public boolean setSafeMode(FSConstants.SafeModeAction action) throws IOException
IOException
ClientProtocol.setSafeMode(
FSConstants.SafeModeAction)
public void refreshNodes() throws IOException
IOException
public void finalizeUpgrade() throws IOException
IOException
public UpgradeStatusReport distributedUpgradeProgress(FSConstants.UpgradeAction action) throws IOException
IOException
public void metaSave(String pathname) throws IOException
IOException
public boolean reportChecksumFailure(Path f, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos)
public FileStatus getFileStatus(Path f) throws IOException
getFileStatus
in class FileSystem
f
- The path we want information from
FileNotFoundException
- if the file does not exist.
IOException
public void setPermission(Path p, FsPermission permission) throws IOException
setPermission
in class FileSystem
IOException
public void setOwner(Path p, String username, String groupname) throws IOException
setOwner
in class FileSystem
p
- The pathusername
- If it is null, the original username remains unchanged.groupname
- If it is null, the original groupname remains unchanged.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |