HDFS-16867. Place MoverMetrics.create after initializing the blockpoolID

This commit is contained in:
Happy-shi 2022-12-19 18:38:37 +08:00
parent d347ff963c
commit 76f0818702
1 changed files with 2 additions and 1 deletions

View File

@ -179,7 +179,6 @@ public class NameNodeConnector implements Closeable {
this.idPath = idPath;
this.targetPaths = targetPaths == null || targetPaths.isEmpty() ? Arrays
.asList(new Path("/")) : targetPaths;
this.moverMetrics = MoverMetrics.create(this);
this.maxNotChangedIterations = maxNotChangedIterations;
int getBlocksMaxQps = conf.getInt(
DFSConfigKeys.DFS_NAMENODE_GETBLOCKS_MAX_QPS_KEY,
@ -204,6 +203,8 @@ public class NameNodeConnector implements Closeable {
final NamespaceInfo namespaceinfo = namenode.versionRequest();
this.blockpoolID = namespaceinfo.getBlockPoolID();
this.moverMetrics = MoverMetrics.create(this);
final FsServerDefaults defaults = fs.getServerDefaults(new Path("/"));
this.keyManager = new KeyManager(blockpoolID, namenode,
defaults.getEncryptDataTransfer(), conf);