You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by so...@apache.org on 2020/06/18 11:44:21 UTC
[hadoop] branch branch-3.3 updated: HDFS-15406. Improve the speed
of Datanode Block Scan. Contributed by hemanthboyina
This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 3dc9db3 HDFS-15406. Improve the speed of Datanode Block Scan. Contributed by hemanthboyina
3dc9db3 is described below
commit 3dc9db3aed3e734453f825116116858f4fff531e
Author: S O'Donnell <so...@cloudera.com>
AuthorDate: Thu Jun 18 12:26:22 2020 +0100
HDFS-15406. Improve the speed of Datanode Block Scan. Contributed by hemanthboyina
(cherry picked from commit 123777823edc98553fcef61f1913ab6e4cd5aa9a)
---
.../hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java | 4 +++-
.../org/apache/hadoop/hdfs/server/datanode/DataNodeTestUtils.java | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
index aa0cc56..5843c7d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
@@ -133,6 +133,7 @@ public class FsVolumeImpl implements FsVolumeSpi {
protected volatile long configuredCapacity;
private final FileIoProvider fileIoProvider;
private final DataNodeVolumeMetrics metrics;
+ private URI baseURI;
/**
* Per-volume worker pool that processes new blocks to cache.
@@ -182,6 +183,7 @@ public class FsVolumeImpl implements FsVolumeSpi {
File parent = currentDir.getParentFile();
cacheExecutor = initializeCacheExecutor(parent);
this.metrics = DataNodeVolumeMetrics.create(conf, parent.getPath());
+ this.baseURI = new File(currentDir.getParent()).toURI();
} else {
cacheExecutor = null;
this.metrics = null;
@@ -506,7 +508,7 @@ public class FsVolumeImpl implements FsVolumeSpi {
@Override
public URI getBaseURI() {
- return new File(currentDir.getParent()).toURI();
+ return baseURI;
}
@Override
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/DataNodeTestUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/DataNodeTestUtils.java
index 453e04f..5d636d5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/DataNodeTestUtils.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/DataNodeTestUtils.java
@@ -239,7 +239,7 @@ public class DataNodeTestUtils {
try (FsDatasetSpi.FsVolumeReferences volumes = dn.getFSDataset()
.getFsVolumeReferences()) {
for (FsVolumeSpi vol : volumes) {
- if (vol.getBaseURI().equals(basePath.toURI())) {
+ if (new File(vol.getBaseURI()).equals(basePath)) {
return (FsVolumeImpl) vol;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org