org.apache.hadoop.dfs
Class DFSAdmin

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      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.


Field Summary
 
Fields inherited from class org.apache.hadoop.fs.FsShell
dateForm, fs, modifFmt
 
Constructor Summary
DFSAdmin()
          Construct a DFSAdmin object.
DFSAdmin(Configuration conf)
          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.
 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.
 int upgradeProgress(String[] argv, int idx)
          Command to request current distributed upgrade status, a detailed status, or to force the upgrade to proceed.
 
Methods inherited from class org.apache.hadoop.fs.FsShell
byteDesc, close, getCurrentTrashDir, init, limitDecimalTo2
 
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, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

DFSAdmin

public DFSAdmin()
Construct a DFSAdmin object.


DFSAdmin

public DFSAdmin(Configuration conf)
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

upgradeProgress

public int upgradeProgress(String[] argv,
                           int idx)
                    throws IOException
Command to request current distributed upgrade status, a detailed status, or to force the upgrade to proceed. Usage: java DFSAdmin -upgradeProgress [status | details | force]

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.

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 © 2008 The Apache Software Foundation