You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/09/15 05:23:13 UTC

[GitHub] [ozone] captainzmc opened a new pull request #2640: HDDS-5742. [Ozone-Streaming] Avoid unnecessary Bytebuffer conversions

captainzmc opened a new pull request #2640:
URL: https://github.com/apache/ozone/pull/2640


   ## What changes were proposed in this pull request?
   
   If checksum is disabled, byteBuffer does not need to be converted. We need to advance if judgments to avoid unnecessary conversions
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5742
   


-- 
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] captainzmc commented on a change in pull request #2640: HDDS-5742. [Ozone-Streaming] Avoid unnecessary Bytebuffer conversions

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #2640:
URL: https://github.com/apache/ozone/pull/2640#discussion_r709796084



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/Checksum.java
##########
@@ -154,11 +158,6 @@ public ChecksumData computeChecksum(List<ByteString> byteStrings)
 
   public ChecksumData computeChecksum(ChunkBuffer data)
       throws OzoneChecksumException {
-    if (checksumType == ChecksumType.NONE) {
-      // Since type is set to NONE, we do not need to compute the checksums
-      return new ChecksumData(checksumType, bytesPerChecksum);
-    }
-

Review comment:
       Yes, I hadn't noticed that this method was used by other codes.  
   I will submit a new PR. We only need to add judgments to computeChecksum(ByteBuffer Data) to avoid redundant ByteBuffer conversions in this method




-- 
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] szetszwo merged pull request #2640: HDDS-5742. [Ozone-Streaming] Avoid unnecessary Bytebuffer conversions

Posted by GitBox <gi...@apache.org>.
szetszwo merged pull request #2640:
URL: https://github.com/apache/ozone/pull/2640


   


-- 
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] szetszwo commented on a change in pull request #2640: HDDS-5742. [Ozone-Streaming] Avoid unnecessary Bytebuffer conversions

Posted by GitBox <gi...@apache.org>.
szetszwo commented on a change in pull request #2640:
URL: https://github.com/apache/ozone/pull/2640#discussion_r709002502



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/Checksum.java
##########
@@ -154,11 +158,6 @@ public ChecksumData computeChecksum(List<ByteString> byteStrings)
 
   public ChecksumData computeChecksum(ChunkBuffer data)
       throws OzoneChecksumException {
-    if (checksumType == ChecksumType.NONE) {
-      // Since type is set to NONE, we do not need to compute the checksums
-      return new ChecksumData(checksumType, bytesPerChecksum);
-    }
-

Review comment:
       On a second thought, we should not remove this if-statement since some other code paths depend on it.  Let's revert the commit.




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