You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ag...@apache.org on 2025/04/10 17:45:57 UTC

(ozone) branch master updated: HDDS-12755. Redundant declaration in TestHadoopNestedDirGenerator#spanCheck() (#8218)

This is an automated email from the ASF dual-hosted git repository.

agupta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ff8ad7a13 HDDS-12755. Redundant declaration in TestHadoopNestedDirGenerator#spanCheck() (#8218)
7ff8ad7a13 is described below

commit 7ff8ad7a132cd2a1632259faf0bed7a164564e8a
Author: Chia-Chuan Yu <yu...@gmail.com>
AuthorDate: Fri Apr 11 01:45:52 2025 +0800

    HDDS-12755. Redundant declaration in TestHadoopNestedDirGenerator#spanCheck() (#8218)
---
 .../ozone/freon/TestHadoopNestedDirGenerator.java      | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestHadoopNestedDirGenerator.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestHadoopNestedDirGenerator.java
index 32ede9d5e1..86545fc88b 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestHadoopNestedDirGenerator.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestHadoopNestedDirGenerator.java
@@ -90,12 +90,10 @@ private void verifyDirTree(String volumeName, String bucketName,
       // verify root path details
       FileStatus[] fileStatuses = fileSystem.listStatus(rootDir);
       Path p = null;
-      for (FileStatus fileStatus : fileStatuses) {
-        // verify the num of peer directories and span directories
-        p = depthBFS(fileSystem, fileStatuses, span, actualDepth);
-        int actualSpan = spanCheck(fileSystem, span, p);
-        assertEquals(span, actualSpan, "Mismatch span in a path");
-      }
+      // verify the num of peer directories and span directories
+      p = depthBFS(fileSystem, fileStatuses, span, actualDepth);
+      int actualSpan = spanCheck(fileSystem, p);
+      assertEquals(span, actualSpan, "Mismatch span in a path");
     }
   }
 
@@ -143,14 +141,8 @@ private Path depthBFS(FileSystem fs, FileStatus[] fileStatuses,
      * and count the span directories.
      */
 
-  private int spanCheck(FileSystem fs, int span, Path p) throws IOException {
+  private int spanCheck(FileSystem fs, Path p) throws IOException {
     int sp = 0;
-    int depth = 0;
-    if (span >= 0) {
-      depth = 0;
-    } else {
-      LOG.info("Span value can never be negative");
-    }
     FileStatus[] fileStatuses = fs.listStatus(p);
     for (FileStatus fileStatus : fileStatuses) {
       if (fileStatus.isDirectory()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org