HDFS-17607. Reduce the number of times conf is loaded when DataNode startUp (#7012). Contributed by lei w.

Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
Lei313 2024-11-04 20:10:08 +08:00 committed by GitHub
parent 4f3abd2f48
commit e4789a2fd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -335,7 +335,7 @@ public VolumeBuilder prepareVolume(DataNode datanode,
VolumeBuilder builder = VolumeBuilder builder =
new VolumeBuilder(this, sd); new VolumeBuilder(this, sd);
for (NamespaceInfo nsInfo : nsInfos) { for (NamespaceInfo nsInfo : nsInfos) {
location.makeBlockPoolDir(nsInfo.getBlockPoolID(), null); location.makeBlockPoolDir(nsInfo.getBlockPoolID(), datanode.getConf());
final BlockPoolSliceStorage bpStorage = getBlockPoolSliceStorage(nsInfo); final BlockPoolSliceStorage bpStorage = getBlockPoolSliceStorage(nsInfo);
final List<StorageDirectory> dirs = bpStorage.loadBpStorageDirectories( final List<StorageDirectory> dirs = bpStorage.loadBpStorageDirectories(
@ -457,7 +457,7 @@ private List<StorageDirectory> loadBlockPoolSliceStorage(DataNode datanode,
final List<StorageDirectory> success = Lists.newArrayList(); final List<StorageDirectory> success = Lists.newArrayList();
final List<UpgradeTask> tasks = Lists.newArrayList(); final List<UpgradeTask> tasks = Lists.newArrayList();
for (StorageLocation dataDir : dataDirs) { for (StorageLocation dataDir : dataDirs) {
dataDir.makeBlockPoolDir(bpid, null); dataDir.makeBlockPoolDir(bpid, datanode.getConf());
try { try {
final List<Callable<StorageDirectory>> sdCallables = final List<Callable<StorageDirectory>> sdCallables =
Lists.newArrayList(); Lists.newArrayList();