You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/04/03 08:04:23 UTC

[GitHub] [ozone] adoroszlai opened a new pull request, #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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

   ## What changes were proposed in this pull request?
   
   Fix findbugs violation in `TestOzoneBlockTokenIdentifier`, which interestingly only appeared in #4506 without any change in that file.
   
   Few other minor fixes in the same file.
   
   https://issues.apache.org/jira/browse/HDDS-8361
   
   ## How was this patch tested?
   
   Findbugs and unit test.
   
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/4594024215


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


[GitHub] [ozone] adoroszlai commented on a diff in pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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


##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/security/token/TestOzoneBlockTokenIdentifier.java:
##########
@@ -260,15 +259,15 @@ public void testAsymmetricTokenPerf() throws NoSuchAlgorithmException,
   }
 
   @Test
-  public void testSymmetricTokenPerf() {
+  void testSymmetricTokenPerf() {
     String hmacSHA1 = "HmacSHA1";
     String hmacSHA256 = "HmacSHA256";
 
     testSymmetricTokenPerfHelper(hmacSHA1, 64);
     testSymmetricTokenPerfHelper(hmacSHA256, 1024);
   }
 
-  public void testSymmetricTokenPerfHelper(String hmacAlgorithm, int keyLen) {
+  private void testSymmetricTokenPerfHelper(String hmacAlgorithm, int keyLen) {

Review Comment:
   No, the problem is fixed by actually using the "useless object" here:
   
   ```
       LOG.info("Average token sign time with {}({} symmetric key) is {} ns",
           hmacAlgorithm, keyLen, duration / tokenPasswordSym.size());
   ```



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


[GitHub] [ozone] ChenSammi merged pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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


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


[GitHub] [ozone] ChenSammi commented on pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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

   The patch LGTM +1. 


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


[GitHub] [ozone] adoroszlai commented on a diff in pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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


##########
hadoop-hdds/hadoop-dependency-test/pom.xml:
##########
@@ -54,6 +54,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>

Review Comment:
   `OzoneBlockTokenIdentifier` is in `hadoop-hdds/common`, so I'm moving the test to the same submodule.  This dependency is required at runtime for Hadoop code invoked by the test.
   
   ```
   [ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.506 s <<< FAILURE! - in org.apache.hadoop.hdds.security.token.TestOzoneBlockTokenIdentifier
   [ERROR] org.apache.hadoop.hdds.security.token.TestOzoneBlockTokenIdentifier.testTokenSerialization  Time elapsed: 0.04 s  <<< ERROR!
   java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64
   	at org.apache.hadoop.security.token.Token.encodeWritable(Token.java:342)
   	at org.apache.hadoop.security.token.Token.encodeToUrlString(Token.java:373)
   	at org.apache.hadoop.hdds.security.token.TestOzoneBlockTokenIdentifier.testTokenSerialization(TestOzoneBlockTokenIdentifier.java:169)
   ```



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


[GitHub] [ozone] ChenSammi commented on a diff in pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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


##########
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/security/token/TestOzoneBlockTokenIdentifier.java:
##########
@@ -260,15 +259,15 @@ public void testAsymmetricTokenPerf() throws NoSuchAlgorithmException,
   }
 
   @Test
-  public void testSymmetricTokenPerf() {
+  void testSymmetricTokenPerf() {
     String hmacSHA1 = "HmacSHA1";
     String hmacSHA256 = "HmacSHA256";
 
     testSymmetricTokenPerfHelper(hmacSHA1, 64);
     testSymmetricTokenPerfHelper(hmacSHA256, 1024);
   }
 
-  public void testSymmetricTokenPerfHelper(String hmacAlgorithm, int keyLen) {
+  private void testSymmetricTokenPerfHelper(String hmacAlgorithm, int keyLen) {

Review Comment:
   @adoroszlai , thanks for fix the issue.  
   Does the scope change from public to private solve the problem? 



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


[GitHub] [ozone] kerneltime commented on pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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

   cc @hemantk-12 can you please take a look?


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


[GitHub] [ozone] ChenSammi commented on a diff in pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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


##########
hadoop-hdds/hadoop-dependency-test/pom.xml:
##########
@@ -54,6 +54,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>

Review Comment:
   Is this change related? 



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


[GitHub] [ozone] adoroszlai commented on pull request #4517: HDDS-8361. Useless object in TestOzoneBlockTokenIdentifier

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

   Thanks @ChenSammi for reviewing and committing it.


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