svn merge -c 1176733 from trunk for HDFS-2363.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1176737 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2011-09-28 06:00:20 +00:00
parent 4f04805d42
commit d04e6af4b7
3 changed files with 8 additions and 5 deletions

View File

@ -689,6 +689,9 @@ Release 0.23.0 - Unreleased
HDFS-2332. Add test for HADOOP-7629 (using an immutable FsPermission HDFS-2332. Add test for HADOOP-7629 (using an immutable FsPermission
object as an RPC parameter fails). (todd) object as an RPC parameter fails). (todd)
HDFS-2363. Move datanodes size printing from FSNamesystem.metasave(..)
to BlockManager. (Uma Maheswara Rao G via szetszwo)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-1458. Improve checkpoint performance by avoiding unnecessary image HDFS-1458. Improve checkpoint performance by avoiding unnecessary image

View File

@ -306,6 +306,11 @@ public class BlockManager {
/** Dump meta data to out. */ /** Dump meta data to out. */
public void metaSave(PrintWriter out) { public void metaSave(PrintWriter out) {
assert namesystem.hasWriteLock(); assert namesystem.hasWriteLock();
final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>();
datanodeManager.fetchDatanodes(live, dead, false);
out.println("Live Datanodes: " + live.size());
out.println("Dead Datanodes: " + dead.size());
// //
// Dump contents of neededReplication // Dump contents of neededReplication
// //

View File

@ -537,11 +537,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
out.println(totalInodes + " files and directories, " + totalBlocks out.println(totalInodes + " files and directories, " + totalBlocks
+ " blocks = " + (totalInodes + totalBlocks) + " total"); + " blocks = " + (totalInodes + totalBlocks) + " total");
final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>();
blockManager.getDatanodeManager().fetchDatanodes(live, dead, false);
out.println("Live Datanodes: "+live.size());
out.println("Dead Datanodes: "+dead.size());
blockManager.metaSave(out); blockManager.metaSave(out);
out.flush(); out.flush();