org.apache.hadoop.dfs
Class DistributedFileSystem
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.FilterFileSystem
org.apache.hadoop.fs.ChecksumFileSystem
org.apache.hadoop.dfs.DistributedFileSystem
- All Implemented Interfaces:
- Configurable
public class DistributedFileSystem
- extends ChecksumFileSystem
Implementation of the abstract FileSystem for the DFS system.
This object is the way end-user code interacts with a Hadoop
DistributedFileSystem.
- Author:
- Mike Cafarella
Methods inherited from class org.apache.hadoop.fs.ChecksumFileSystem |
completeLocalOutput, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, delete, getBytesPerSum, getChecksumFile, getChecksumFileLength, getRawFileSystem, isChecksumFile, listPaths, listPaths, lock, mkdirs, open, release, rename, setReplication, startLocalOutput |
Methods inherited from class org.apache.hadoop.fs.FilterFileSystem |
checkPath, exists, getBlockSize, getConf, getDefaultBlockSize, getDefaultReplication, getFileCacheHints, getLength, getName, getReplication, getUri, getWorkingDirectory, initialize, isDirectory, makeQualified, setWorkingDirectory |
Methods inherited from class org.apache.hadoop.fs.FileSystem |
close, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, createNewFile, get, get, getContentLength, getLocal, getNamed, getUsed, globPaths, globPaths, isFile, listPaths, listPaths, moveFromLocalFile, moveToLocalFile, open, parseArgs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedFileSystem
public DistributedFileSystem()
DistributedFileSystem
public DistributedFileSystem(InetSocketAddress namenode,
Configuration conf)
throws IOException
- Deprecated.
- Throws:
IOException
getRawCapacity
public long getRawCapacity()
throws IOException
- Return the total raw capacity of the filesystem, disregarding
replication .
- Throws:
IOException
getRawUsed
public long getRawUsed()
throws IOException
- Return the total raw used space in the filesystem, disregarding
replication .
- Throws:
IOException
getDataNodeStats
public DatanodeInfo[] getDataNodeStats()
throws IOException
- Return statistics for each datanode.
- Throws:
IOException
setSafeMode
public boolean setSafeMode(FSConstants.SafeModeAction action)
throws IOException
- Enter, leave or get safe mode.
- Throws:
IOException
- See Also:
ClientProtocol.setSafeMode(FSConstants.SafeModeAction)
refreshNodes
public void refreshNodes()
throws IOException
- Throws:
IOException
reportChecksumFailure
public void reportChecksumFailure(Path f,
FSDataInputStream in,
long inPos,
FSDataInputStream sums,
long sumsPos)
- We need to find the blocks that didn't match. Likely only one
is corrupt but we will report both to the namenode. In the future,
we can consider figuring out exactly which block is corrupt.
- Specified by:
reportChecksumFailure
in class ChecksumFileSystem
- Parameters:
f
- the file name containing the errorin
- the stream open on the fileinPos
- the position of the beginning of the bad data in the filesums
- the stream open on the checksum filesumsPos
- the position of the beginning of the bad data in the checksum file
Copyright © 2006 The Apache Software Foundation