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 decommission(String[] argv, int idx)
          Command related to decommission of a datanode.
static void main(String[] argv)
          main() has some simple utility methods.
 void printUsage(String cmd)
          Displays format of commands.
 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.

decommission

public int decommission(String[] argv,
                        int idx)
                 throws IOException
Command related to decommission of a datanode. Usage: java DFSAdmin -decommission [enter | leave | get]

Parameters:
argv - List of command line parameters. Each of these items could be a hostname or a hostname:portname.
idx - The index of the command that is being processed.
Returns:
0 on success, non zero on error.
Throws:
IOException - if the filesystem does not exist.

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