org.apache.hadoop.dfs
Class DFSAdmin

java.lang.Object
  extended by org.apache.hadoop.util.ToolBase
      extended by org.apache.hadoop.fs.FsShell
          extended by org.apache.hadoop.dfs.DFSAdmin
All Implemented Interfaces:
Configurable, Tool

public class DFSAdmin
extends FsShell

This class provides some DFS administrative access.

Author:
Dhruba Borthakur

Field Summary
 
Fields inherited from class org.apache.hadoop.fs.FsShell
fs
 
Fields inherited from class org.apache.hadoop.util.ToolBase
conf
 
Constructor Summary
DFSAdmin()
          Construct a DFSAdmin object.
 
Method Summary
 int finalizeUpgrade()
          Command to ask the namenode to finalize previously performed upgrade.
static void main(String[] argv)
          main() has some simple utility methods.
 int metaSave(String[] argv, int idx)
          Dumps DFS data structures into specified file.
 void printUsage(String cmd)
          Displays format of commands.
 int refreshNodes()
          Command to ask the namenode to reread the hosts and excluded hosts file.
 void report()
          Gives a report on how the FileSystem is doing.
 int run(String[] argv)
          run
 void setSafeMode(String[] argv, int idx)
          Safe mode maintenance command.
 
Methods inherited from class org.apache.hadoop.fs.FsShell
byteDesc, copy, delete, du, dus, init, limitDecimal, ls, mkdir, rename, setReplication
 
Methods inherited from class org.apache.hadoop.util.ToolBase
doMain, getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFSAdmin

public DFSAdmin()
Construct a DFSAdmin object.

Method Detail

report

public void report()
            throws IOException
Gives a report on how the FileSystem is doing.

Throws:
IOException - if the filesystem does not exist.

setSafeMode

public void setSafeMode(String[] argv,
                        int idx)
                 throws IOException
Safe mode maintenance command. Usage: java DFSAdmin -safemode [enter | leave | get]

Parameters:
argv - List of of command line parameters.
idx - The index of the command that is being processed.
Throws:
IOException - if the filesystem does not exist.

refreshNodes

public int refreshNodes()
                 throws IOException
Command to ask the namenode to reread the hosts and excluded hosts file. Usage: java DFSAdmin -refreshNodes

Throws:
IOException

finalizeUpgrade

public int finalizeUpgrade()
                    throws IOException
Command to ask the namenode to finalize previously performed upgrade. Usage: java DFSAdmin -finalizeUpgrade

Throws:
IOException

metaSave

public int metaSave(String[] argv,
                    int idx)
             throws IOException
Dumps DFS data structures into specified file. Usage: java DFSAdmin -metasave filename

Parameters:
argv - List of of command line parameters.
idx - The index of the command that is being processed.
Throws:
IOException - if an error accoured wile accessing the file or path.

printUsage

public void printUsage(String cmd)
Displays format of commands.

Overrides:
printUsage in class FsShell
Parameters:
cmd - The command that is being executed.

run

public int run(String[] argv)
        throws Exception
Description copied from class: FsShell
run

Specified by:
run in interface Tool
Overrides:
run in class FsShell
Parameters:
argv - The parameters passed to this program.
Returns:
0 on success, non zero on error.
Throws:
Exception - if the filesystem does not exist.

main

public static void main(String[] argv)
                 throws Exception
main() has some simple utility methods.

Parameters:
argv - Command line parameters.
Throws:
Exception - if the filesystem does not exist.


Copyright © 2006 The Apache Software Foundation