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 12:13:45 UTC
[hadoop] branch branch-3.1 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.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 9d891f0 HDFS-15406. Improve the speed of Datanode Block Scan. Contributed by hemanthboyina
9d891f0 is described below
commit 9d891f08c28d1acdd0c1527efb784972f739ad1b
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 5a8229a..8810bfc 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.
@@ -175,6 +176,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;
@@ -500,7 +502,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 bb78cbc..6201624 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