From 8bf19a216cc667d817313c6f07510425dc1aa106 Mon Sep 17 00:00:00 2001 From: zeekling Date: Sun, 31 Mar 2024 21:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0hdfs=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | 3 +++ .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 1 + .../hadoop/hdfs/server/namenode/INodeAttributeProvider.java | 1 + 3 files changed, 5 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java index 37b368c31f..eb23a2a760 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java @@ -201,6 +201,9 @@ private static INodeDirectory createRoot(FSNamesystem namesystem) { private final String supergroup; private final INodeId inodeId; + /** + * 写editlog。 + */ private final FSEditLog editLog; private HdfsFileStatus[] reservedStatuses; 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 3267b6fc12..dd966b9e4d 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 @@ -1233,6 +1233,7 @@ private void loadFSImage(StartupOption startOpt) throws IOException { writeLock(); try { // We shouldn't be calling saveNamespace if we've come up in standby state. + // 根据启动选项及其对应存储目录(${dfs.name.dir}),分析存储目录,必要的话从先前的事务恢复过来 MetaRecoveryContext recovery = startOpt.createRecoveryContext(); final boolean staleImage = fsImage.recoverTransitionRead(startOpt, this, recovery); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeAttributeProvider.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeAttributeProvider.java index e83c962a4a..c4834bcc25 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeAttributeProvider.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeAttributeProvider.java @@ -34,6 +34,7 @@ @InterfaceStability.Unstable public abstract class INodeAttributeProvider { + // 访问控制执行者接口 public static class AuthorizationContext { private String fsOwner; private String supergroup;