Skip to content

chore: add crc32c combine utility - #1376

Merged
BenWhitehead merged 14 commits into
feat/grpc-storagefrom
crc32c_utility
May 5, 2022
Merged

chore: add crc32c combine utility#1376
BenWhitehead merged 14 commits into
feat/grpc-storagefrom
crc32c_utility

Conversation

@frankyn

@frankyn frankyn commented May 3, 2022

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Ensure the tests and linter pass
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels May 3, 2022
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels May 4, 2022
@frankyn frankyn changed the title Crc32c utility May 4, 2022
@frankyn
frankyn marked this pull request as ready for review May 4, 2022 19:57
@frankyn
frankyn requested a review from a team May 4, 2022 19:57

@BenWhitehead BenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things to clean up, after that it should be ready to merge.

Additionally, can you retarget this PR to feat/grpc-storage instead of main?

Comment on lines +286 to +289
/*
There is a more efficient implementation in https://github.com/google/crc32c, however for brevity we are following
the byte by byte computation, implemented in: https://github.com/google/crc32c/blob/main/src/crc32c_portable.cc#L252-L257
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets replace this with an actual javadoc comment for the method.

  /**
   * Straight forward implementation to concatenate ...
   * @param crc1
   * @param crc2
   * @param crc2ObjectSize
   * @return
   * @see <a target="_blank" rel="noopener noreferrer" href="https://github.com/google/crc32c/blob/main/src/crc32c_portable.cc#L252-L257">https://github.com/google/crc32c/blob/main/src/crc32c_portable.cc#L252-L257</a>
   */

We can also link to the actual code from the javadoc comment and it will be turned into a clickable link rather than simply text.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/Crc32cUtility.java Outdated
Comment on lines +22 to +24
/*
Implementation borrowed taken from: https://github.com/google/crc32c/blob/main/src/crc32c_portable.cc#L16-L59
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we javadoc this comment similar to the method?

Also, for all links to github we should link to the SHA of the code rather than main so the link is stable and the line numbers are known.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also probably some phrasing like "Ported from ..." instead of "borrowed/taken"

…c32cUtility.java

Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
@frankyn
frankyn changed the base branch from main to feat/grpc-storage May 5, 2022 19:03
@frankyn
frankyn requested a review from BenWhitehead May 5, 2022 19:34

@BenWhitehead BenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

Two more recommendations for git links. After that feel free to merge.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/Crc32cUtility.java Outdated
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/Crc32cUtility.java Outdated
frankyn and others added 2 commits May 5, 2022 14:41
…c32cUtility.java

Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
…c32cUtility.java

Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
@frankyn frankyn added the automerge Merge the pull request once unit tests and other checks pass. label May 5, 2022
@BenWhitehead BenWhitehead removed the automerge Merge the pull request once unit tests and other checks pass. label May 5, 2022
@BenWhitehead
BenWhitehead merged commit 2f46646 into feat/grpc-storage May 5, 2022
@BenWhitehead
BenWhitehead deleted the crc32c_utility branch May 5, 2022 23:37
sydney-munro pushed a commit that referenced this pull request Jun 7, 2022
Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. size: l Pull request size is large.

2 participants