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 aa...@apache.org on 2021/10/28 02:47:31 UTC
[hadoop] branch branch-3.2.3 updated: HADOOP-17972. Backport
HADOOP-17683 for branch-3.2 (#3573)
This is an automated email from the ASF dual-hosted git repository.
aajisaka pushed a commit to branch branch-3.2.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2.3 by this push:
new 0a51b7f HADOOP-17972. Backport HADOOP-17683 for branch-3.2 (#3573)
0a51b7f is described below
commit 0a51b7fd116325ce3f9c261e9fd6f002a31fa90f
Author: Ananya Singh <pu...@gmail.com>
AuthorDate: Thu Oct 28 08:16:12 2021 +0530
HADOOP-17972. Backport HADOOP-17683 for branch-3.2 (#3573)
Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
Signed-off-by: Akira Ajisaka <aa...@apache.org>
(cherry picked from commit df9c07fc042cb5bc6b8b6090b579ccb9b8020290)
---
.../src/main/java/org/apache/hadoop/fs/FileUtil.java | 18 ++++++------------
hadoop-project/pom.xml | 2 +-
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
index 7b8a05f..fe7b3eb 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
@@ -600,18 +600,12 @@ public class FileUtil {
return dir.length();
} else {
File[] allFiles = dir.listFiles();
- if(allFiles != null) {
- for (int i = 0; i < allFiles.length; i++) {
- boolean isSymLink;
- try {
- isSymLink = org.apache.commons.io.FileUtils.isSymlink(allFiles[i]);
- } catch(IOException ioe) {
- isSymLink = true;
- }
- if(!isSymLink) {
- size += getDU(allFiles[i]);
- }
- }
+ if (allFiles != null) {
+ for (File f : allFiles) {
+ if (!org.apache.commons.io.FileUtils.isSymlink(f)) {
+ size += getDU(f);
+ }
+ }
}
return size;
}
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index c1c8d38..4e28c22 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -110,7 +110,7 @@
<commons-collections.version>3.2.2</commons-collections.version>
<commons-compress.version>1.21</commons-compress.version>
<commons-csv.version>1.0</commons-csv.version>
- <commons-io.version>2.5</commons-io.version>
+ <commons-io.version>2.8.0</commons-io.version>
<commons-lang3.version>3.7</commons-lang3.version>
<commons-logging.version>1.1.3</commons-logging.version>
<commons-logging-api.version>1.1</commons-logging-api.version>
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org