You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/12/01 15:31:11 UTC

[GitHub] [hadoop] amahussein commented on a change in pull request #2501: HDFS-15648. TestFileChecksum should be parameterized with a boolean flag.

amahussein commented on a change in pull request #2501:
URL: https://github.com/apache/hadoop/pull/2501#discussion_r533502898



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileChecksum.java
##########
@@ -220,7 +217,7 @@ public void testStripedAndReplicatedFileChecksum() throws Exception {
     FileChecksum replicatedFileChecksum = getFileChecksum(replicatedFile,
         10, false);
 
-    if (expectComparableStripedAndReplicatedFiles()) {
+    if (expectComparableStripedAndReplicatedFiles) {

Review comment:
       We could keep the methods which returns the `isCompositeCRC` flag. This will reduce the diff and make the implementation flexible and maintainable for future changes.

##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileChecksum.java
##########
@@ -77,6 +81,31 @@
   private String stripedFile2 = ecDir + "/stripedFileChecksum2";
   private String replicatedFile = "/replicatedFileChecksum";
 
+  private String checksumCombineMode;
+  private boolean expectComparableStripedAndReplicatedFiles;
+  private boolean expectComparableDifferentBlockSizeReplicatedFiles;

Review comment:
       Do we need three boolean fields? It seems that the three booleans have the same value.
   Maybe we should simplify the implementation by replacing the three fields by a single field (i.e., `isCompositeCRC`)




----------------------------------------------------------------
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.

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



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