org.apache.hadoop.dfs
Class NamenodeFsck

java.lang.Object
  extended by org.apache.hadoop.dfs.NamenodeFsck

public class NamenodeFsck
extends Object

This class provides rudimentary checking of DFS volumes for errors and sub-optimal conditions.

The tool scans all files and directories, starting from an indicated root path. The following abnormal conditions are detected and handled:

Additionally, the tool collects a detailed overall DFS statistics, and optionally can print detailed statistics on block locations and replication factors of each file.

Author:
Andrzej Bialecki

Nested Class Summary
 class NamenodeFsck.FsckResult
          FsckResult of checking, plus overall DFS statistics.
 
Field Summary
static int FIXING_DELETE
          Delete corrupted files.
static int FIXING_MOVE
          Move corrupted files to /lost+found .
static int FIXING_NONE
          Don't attempt any fixing .
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
NamenodeFsck(Configuration conf, NameNode nn, Map<String,String[]> pmap, javax.servlet.http.HttpServletResponse response)
          Filesystem checker.
 
Method Summary
 void fsck()
          Check files on DFS, starting from the indicated path.
 int run(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

FIXING_NONE

public static final int FIXING_NONE
Don't attempt any fixing .

See Also:
Constant Field Values

FIXING_MOVE

public static final int FIXING_MOVE
Move corrupted files to /lost+found .

See Also:
Constant Field Values

FIXING_DELETE

public static final int FIXING_DELETE
Delete corrupted files.

See Also:
Constant Field Values
Constructor Detail

NamenodeFsck

public NamenodeFsck(Configuration conf,
                    NameNode nn,
                    Map<String,String[]> pmap,
                    javax.servlet.http.HttpServletResponse response)
             throws IOException
Filesystem checker.

Parameters:
conf - configuration (namenode config)
nn - namenode that this fsck is going to use
pmap - key=value[] map that is passed to the http servlet as url parameters
response - the object into which this servelet writes the url contents
Throws:
IOException
Method Detail

fsck

public void fsck()
          throws IOException
Check files on DFS, starting from the indicated path.

Throws:
Exception
IOException

run

public int run(String[] args)
        throws Exception
Parameters:
args -
Throws:
Exception


Copyright © 2006 The Apache Software Foundation