From e4789a2fd3ee6aada38bcc780b83ba696369f350 Mon Sep 17 00:00:00 2001 From: Lei313 <47049042+ThinkerLei@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:10:08 +0800 Subject: [PATCH] HDFS-17607. Reduce the number of times conf is loaded when DataNode startUp (#7012). Contributed by lei w. Signed-off-by: He Xiaoqiao --- .../org/apache/hadoop/hdfs/server/datanode/DataStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java index 590cd9f579..444f4df2ff 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java @@ -335,7 +335,7 @@ public VolumeBuilder prepareVolume(DataNode datanode, VolumeBuilder builder = new VolumeBuilder(this, sd); for (NamespaceInfo nsInfo : nsInfos) { - location.makeBlockPoolDir(nsInfo.getBlockPoolID(), null); + location.makeBlockPoolDir(nsInfo.getBlockPoolID(), datanode.getConf()); final BlockPoolSliceStorage bpStorage = getBlockPoolSliceStorage(nsInfo); final List dirs = bpStorage.loadBpStorageDirectories( @@ -457,7 +457,7 @@ private List loadBlockPoolSliceStorage(DataNode datanode, final List success = Lists.newArrayList(); final List tasks = Lists.newArrayList(); for (StorageLocation dataDir : dataDirs) { - dataDir.makeBlockPoolDir(bpid, null); + dataDir.makeBlockPoolDir(bpid, datanode.getConf()); try { final List> sdCallables = Lists.newArrayList();