HDFS-16819. Modify patch based on comments

This commit is contained in:
Haiyang.Hu 2022-10-27 10:37:15 +08:00
parent 09dacd784a
commit 77cc37d29a
1 changed files with 1 additions and 2 deletions

View File

@ -1888,7 +1888,6 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
invalidate(b.getBlockPoolId(), new Block[] { lastFoundReplicaInfo }, invalidate(b.getBlockPoolId(), new Block[] { lastFoundReplicaInfo },
false); false);
} }
long startHoldLockTimeMs = Time.monotonicNow();
FsVolumeReference ref = volumes.getNextVolume(storageType, storageId, b FsVolumeReference ref = volumes.getNextVolume(storageType, storageId, b
.getNumBytes()); .getNumBytes());
FsVolumeImpl v = (FsVolumeImpl) ref.getVolume(); FsVolumeImpl v = (FsVolumeImpl) ref.getVolume();
@ -1909,7 +1908,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
} finally { } finally {
if (dataNodeMetrics != null) { if (dataNodeMetrics != null) {
// Create temporary operation hold write lock once. // Create temporary operation hold write lock once.
long createTemporaryOpMs = Time.monotonicNow() - startHoldLockTimeMs; long createTemporaryOpMs = Time.monotonicNow() - startTimeMs;
dataNodeMetrics.addCreateTemporaryOp(createTemporaryOpMs); dataNodeMetrics.addCreateTemporaryOp(createTemporaryOpMs);
} }
} }