org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool@Private
public class DFSAdmin
extends org.apache.hadoop.fs.FsShell
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String[] |
DFS_REPORT_ARGS |
| Constructor | Description |
|---|---|
DFSAdmin() |
Construct a DFSAdmin object.
|
DFSAdmin(org.apache.hadoop.conf.Configuration conf) |
Construct a DFSAdmin object.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
allowSnapshot(java.lang.String[] argv) |
Allow snapshot on a directory.
|
void |
disallowSnapshot(java.lang.String[] argv) |
Disallow snapshot on a directory.
|
int |
fetchImage(java.lang.String[] argv,
int idx) |
Download the most recent fsimage from the name node, and save it to a local
file in the given directory.
|
int |
finalizeUpgrade() |
Command to ask the namenode to finalize previously performed upgrade.
|
int |
genericRefresh(java.lang.String[] argv,
int i) |
|
int |
getBalancerBandwidth(java.lang.String[] argv,
int idx) |
Command to get balancer bandwidth for the given datanode.
|
protected org.apache.hadoop.hdfs.DistributedFileSystem |
getDFS() |
|
int |
getUpgradeStatus() |
Command to get the upgrade status of each namenode in the nameservice.
|
int |
listOpenFiles(java.lang.String[] argv) |
Command to list all the open files currently managed by NameNode.
|
static void |
main(java.lang.String[] argv) |
main() has some simple utility methods.
|
int |
metaSave(java.lang.String[] argv,
int idx) |
Dumps DFS data structures into specified file.
|
int |
printTopology() |
Display each rack and the nodes assigned to that rack, as determined
by the NameNode, in a hierarchical manner.
|
void |
provisionSnapshotTrash(java.lang.String[] argv) |
Provision trash root in a snapshottable directory.
|
int |
reconfig(java.lang.String[] argv,
int i) |
|
int |
refreshCallQueue() |
|
int |
refreshNodes() |
Command to ask the namenode to reread the hosts and excluded hosts
file.
|
int |
refreshServiceAcl() |
Refresh the authorization policy on the
NameNode. |
int |
refreshSuperUserGroupsConfiguration() |
refreshSuperUserGroupsConfiguration
NameNode. |
int |
refreshUserToGroupsMappings() |
Refresh the user-to-groups mappings on the
NameNode. |
void |
report(java.lang.String[] argv,
int i) |
Gives a report on how the FileSystem is doing.
|
int |
restoreFailedStorage(java.lang.String arg) |
Command to enable/disable/check restoring of failed storage replicas in the namenode.
|
int |
rollEdits() |
|
int |
run(java.lang.String[] argv) |
|
int |
saveNamespace(java.lang.String[] argv) |
Command to ask the namenode to save the namespace.
|
int |
setBalancerBandwidth(java.lang.String[] argv,
int idx) |
Command to ask the active namenode to set the balancer bandwidth.
|
void |
setSafeMode(java.lang.String[] argv,
int idx) |
Safe mode maintenance command.
|
int |
triggerBlockReport(java.lang.String[] argv) |
|
int |
upgrade(java.lang.String arg) |
Upgrade command to get the status of upgrade or ask NameNode to finalize
the previously performed upgrade.
|
close, getCurrentTrashDir, getCurrentTrashDir, getFS, getHelp, getTrash, getUsagePrefix, init, newShellInstance, registerCommandspublic DFSAdmin()
public DFSAdmin(org.apache.hadoop.conf.Configuration conf)
protected org.apache.hadoop.hdfs.DistributedFileSystem getDFS()
throws java.io.IOException
java.io.IOExceptionpublic void report(java.lang.String[] argv,
int i)
throws java.io.IOException
java.io.IOException - if the filesystem does not exist.public void setSafeMode(java.lang.String[] argv,
int idx)
throws java.io.IOException
argv - List of of command line parameters.idx - The index of the command that is being processed.java.io.IOException - if the filesystem does not exist.public int triggerBlockReport(java.lang.String[] argv)
throws java.io.IOException
java.io.IOExceptionpublic void allowSnapshot(java.lang.String[] argv)
throws java.io.IOException
argv - List of of command line parameters.java.io.IOExceptionpublic void disallowSnapshot(java.lang.String[] argv)
throws java.io.IOException
argv - List of of command line parameters.java.io.IOExceptionpublic void provisionSnapshotTrash(java.lang.String[] argv)
throws java.io.IOException
argv - List of of command line parameters.java.io.IOExceptionpublic int saveNamespace(java.lang.String[] argv)
throws java.io.IOException
java.io.IOExceptionClientProtocol.saveNamespace(long, long)public int rollEdits()
throws java.io.IOException
java.io.IOExceptionpublic int restoreFailedStorage(java.lang.String arg)
throws java.io.IOException
java.io.IOExceptionClientProtocol.restoreFailedStorage(String arg)public int refreshNodes()
throws java.io.IOException
java.io.IOExceptionpublic int listOpenFiles(java.lang.String[] argv)
throws java.io.IOException
argv - java.io.IOExceptionpublic int setBalancerBandwidth(java.lang.String[] argv,
int idx)
throws java.io.IOException
argv - List of of command line parameters.idx - The index of the command that is being processed.java.io.IOExceptionpublic int getBalancerBandwidth(java.lang.String[] argv,
int idx)
throws java.io.IOException
argv - List of of command line parameters.idx - The index of the command that is being processed.java.io.IOExceptionpublic int fetchImage(java.lang.String[] argv,
int idx)
throws java.io.IOException
argv - List of of command line parameters.idx - The index of the command that is being processed.java.io.IOExceptionpublic int finalizeUpgrade()
throws java.io.IOException
java.io.IOExceptionpublic int getUpgradeStatus()
throws java.io.IOException
java.io.IOExceptionpublic int upgrade(java.lang.String arg)
throws java.io.IOException
java.io.IOExceptionpublic int metaSave(java.lang.String[] argv,
int idx)
throws java.io.IOException
argv - List of of command line parameters.idx - The index of the command that is being processed.java.io.IOException - if an error occurred while accessing
the file or path.public int printTopology()
throws java.io.IOException
java.io.IOException - If an error while getting datanode reportpublic int refreshServiceAcl()
throws java.io.IOException
NameNode.java.io.IOExceptionpublic int refreshUserToGroupsMappings()
throws java.io.IOException
NameNode.java.io.IOExceptionpublic int refreshSuperUserGroupsConfiguration()
throws java.io.IOException
NameNode.java.io.IOExceptionpublic int refreshCallQueue()
throws java.io.IOException
java.io.IOExceptionpublic int reconfig(java.lang.String[] argv,
int i)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic int genericRefresh(java.lang.String[] argv,
int i)
throws java.io.IOException
java.io.IOExceptionpublic int run(java.lang.String[] argv)
run in interface org.apache.hadoop.util.Toolrun in class org.apache.hadoop.fs.FsShellargv - The parameters passed to this program.public static void main(java.lang.String[] argv)
throws java.lang.Exception
argv - Command line parameters.java.lang.Exception - if the filesystem does not exist.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.