From f1560d379d314e0702e878a0ea5fcf2e99884c7c Mon Sep 17 00:00:00 2001 From: Harsh J Date: Sun, 13 May 2012 03:33:19 +0000 Subject: [PATCH] HDFS-2312. FSNamesystem javadoc incorrectly says its for DNs. (harsh) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1337761 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../hdfs/server/namenode/FSNamesystem.java | 27 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a1fa36f495f..6e0a46daff6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -141,6 +141,8 @@ Trunk (unreleased changes) HDFS-3243. TestParallelRead timing out on jenkins. (Henry Robinson via todd) HDFS-3265. PowerPc Build error. (Kumar Ravi via mattf) + + HDFS-2312. FSNamesystem javadoc incorrectly says its for DNs. (harsh) Release 2.0.0 - UNRELEASED diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index f1072f9bfe3..d1876ea78aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -197,18 +197,33 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -/*************************************************** - * FSNamesystem does the actual bookkeeping work for the - * DataNode. +/** + * FSNamesystem is a container of both transient + * and persisted name-space state, and does all the book-keeping + * work on a NameNode. * - * It tracks several important tables. + * Its roles are briefly described below: * - * 1) valid fsname --> blocklist (kept on disk, logged) + * 1) Is the container for BlockManager, DatanodeManager, + * DelegationTokens, LeaseManager, etc. services. + * 2) RPC calls that modify or inspect the name-space + * should get delegated here. + * 3) Anything that touches only blocks (eg. block reports), + * it delegates to BlockManager. + * 4) Anything that touches only file information (eg. permissions, mkdirs), + * it delegates to FSDirectory. + * 5) Anything that crosses two of the above components should be + * coordinated here. + * 6) Logs mutations to FSEditLog. + * + * This class and its contents keep: + * + * 1) Valid fsname --> blocklist (kept on disk, logged) * 2) Set of all valid blocks (inverted #1) * 3) block --> machinelist (kept in memory, rebuilt dynamically from reports) * 4) machine --> blocklist (inverted #2) * 5) LRU cache of updated-heartbeat machines - ***************************************************/ + */ @InterfaceAudience.Private @Metrics(context="dfs") public class FSNamesystem implements Namesystem, FSClusterStats,