You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ivanzlenko (via GitHub)" <gi...@apache.org> on 2025/04/20 18:18:12 UTC

[PR] HDDS-12878. Make test files compliant with FieldDeclarationsShouldBeAtStartOfClass [ozone]

ivanzlenko opened a new pull request, #8308:
URL: https://github.com/apache/ozone/pull/8308

   ## What changes were proposed in this pull request?
   
   Code for the tests made compliant with PMD.FieldDeclarationsShouldBeAtStartOfClass verification rule.
   It is done before enabling the rule itself to prevent us reviewing a very huge PR.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-12878
   
   ## How was this patch tested?
   
   Patch tested using standard verification pipeline.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #8308:
URL: https://github.com/apache/ozone/pull/8308#issuecomment-2833537987

   Thanks @ivanzlenko for the patch, @myskov for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "ivanzlenko (via GitHub)" <gi...@apache.org>.
ivanzlenko commented on code in PR #8308:
URL: https://github.com/apache/ozone/pull/8308#discussion_r2062626101


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java:
##########
@@ -42,6 +42,10 @@ public class TestOzoneLockProvider {
   private OzoneManager ozoneManager;
   private OzoneLockStrategy ozoneLockStrategy;
 
+  private boolean keyPathLockEnabled;
+
+  private boolean enableFileSystemPaths;

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Make test files compliant with FieldDeclarationsShouldBeAtStartOfClass [ozone]

Posted by "ivanzlenko (via GitHub)" <gi...@apache.org>.
ivanzlenko commented on PR #8308:
URL: https://github.com/apache/ozone/pull/8308#issuecomment-2823421159

   @myskov thanks for the review! I've fixed your comments


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #8308:
URL: https://github.com/apache/ozone/pull/8308#discussion_r2062526565


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java:
##########
@@ -39,6 +39,12 @@
  */
 public class ObjectStoreStub extends ObjectStore {
 
+  private static OzoneConfiguration conf = new OzoneConfiguration();
+
+  private Map<String, OzoneVolumeStub> volumes = new HashMap<>();
+
+  private Map<String, Boolean> bucketEmptyStatus = new HashMap<>();

Review Comment:
   Please don't add empty lines.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java:
##########
@@ -42,6 +42,10 @@ public class TestOzoneLockProvider {
   private OzoneManager ozoneManager;
   private OzoneLockStrategy ozoneLockStrategy;
 
+  private boolean keyPathLockEnabled;
+
+  private boolean enableFileSystemPaths;

Review Comment:
   Please don't add empty lines.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Make test files compliant with FieldDeclarationsShouldBeAtStartOfClass [ozone]

Posted by "ivanzlenko (via GitHub)" <gi...@apache.org>.
ivanzlenko commented on code in PR #8308:
URL: https://github.com/apache/ozone/pull/8308#discussion_r2055476406


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java:
##########
@@ -73,6 +73,7 @@ public ScmTestMock(String clusterId) {
     this.clusterId = clusterId;
     this.scmId = UUID.randomUUID().toString();
   }
+

Review Comment:
   This is a checkstyle "bug" introduced in previous commit for container-service module



##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/ContainerTestVersionInfo.java:
##########
@@ -57,6 +57,7 @@ public class ContainerTestVersionInfo {
   }
 
   private final String schemaVersion;
+

Review Comment:
   done



##########
hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java:
##########
@@ -46,21 +46,20 @@
  */
 public final class RawErasureCoderBenchmark {
 
-  private RawErasureCoderBenchmark() {
-    // prevent instantiation
-  }
-
   // target size of input data buffer
   private static final int TARGET_BUFFER_SIZE_MB = 126;
 
-  private static final int MAX_CHUNK_SIZE =
-      TARGET_BUFFER_SIZE_MB / BenchData.NUM_DATA_UNITS * 1024;

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Make test files compliant with FieldDeclarationsShouldBeAtStartOfClass [ozone]

Posted by "myskov (via GitHub)" <gi...@apache.org>.
myskov commented on code in PR #8308:
URL: https://github.com/apache/ozone/pull/8308#discussion_r2055460509


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/ScmTestMock.java:
##########
@@ -73,6 +73,7 @@ public ScmTestMock(String clusterId) {
     this.clusterId = clusterId;
     this.scmId = UUID.randomUUID().toString();
   }
+

Review Comment:
   not related to the FieldDeclarationsShouldBeAtStartOfClass



##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/ContainerTestVersionInfo.java:
##########
@@ -57,6 +57,7 @@ public class ContainerTestVersionInfo {
   }
 
   private final String schemaVersion;
+

Review Comment:
   not related to the FieldDeclarationsShouldBeAtStartOfClass



##########
hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java:
##########
@@ -46,21 +46,20 @@
  */
 public final class RawErasureCoderBenchmark {
 
-  private RawErasureCoderBenchmark() {
-    // prevent instantiation
-  }
-
   // target size of input data buffer
   private static final int TARGET_BUFFER_SIZE_MB = 126;
 
-  private static final int MAX_CHUNK_SIZE =
-      TARGET_BUFFER_SIZE_MB / BenchData.NUM_DATA_UNITS * 1024;

Review Comment:
   also not related change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #8308:
URL: https://github.com/apache/ozone/pull/8308


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "ivanzlenko (via GitHub)" <gi...@apache.org>.
ivanzlenko commented on code in PR #8308:
URL: https://github.com/apache/ozone/pull/8308#discussion_r2062625934


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java:
##########
@@ -39,6 +39,12 @@
  */
 public class ObjectStoreStub extends ObjectStore {
 
+  private static OzoneConfiguration conf = new OzoneConfiguration();
+
+  private Map<String, OzoneVolumeStub> volumes = new HashMap<>();
+
+  private Map<String, Boolean> bucketEmptyStatus = new HashMap<>();

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-12878. Move field declarations to start of class in tests [ozone]

Posted by "ivanzlenko (via GitHub)" <gi...@apache.org>.
ivanzlenko commented on PR #8308:
URL: https://github.com/apache/ozone/pull/8308#issuecomment-2833538339

   @adoroszlai @myskov thanks for the review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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