Skip to content

HDDS-15689. Compare MD5Hash directly in ScmInvokerCodeGenerator#10618

Merged
adoroszlai merged 1 commit into
apache:masterfrom
adoroszlai:HDDS-15689
Jun 27, 2026
Merged

HDDS-15689. Compare MD5Hash directly in ScmInvokerCodeGenerator#10618
adoroszlai merged 1 commit into
apache:masterfrom
adoroszlai:HDDS-15689

Conversation

@adoroszlai

@adoroszlai adoroszlai commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

final MD5Hash javaMd5 = MD5FileUtil.computeMd5ForFile(java);
final MD5Hash tmpMd5 = MD5FileUtil.computeMd5ForFile(tmp);
if (Arrays.equals(javaMd5.getDigest(), tmpMd5.getDigest())) {

getDigest() returns byte[] in Ratis 3.2.1, but ByteBuffer in 3.2.2 (RATIS-2361), resulting in compile error:

ScmInvokerCodeGenerator.java:[645,15] no suitable method found for equals(java.nio.ByteBuffer,java.nio.ByteBuffer)

MD5Hash#equals is based on digest internally, so we can make ScmInvokerCodeGenerator work with both versions of Ratis by checking equality of MD5Hash itself.

https://issues.apache.org/jira/browse/HDDS-15689

How was this patch tested?

Build, checkstyle, TestScmInvokerCodeGenerator

Build with Ratis 3.2.2:
https://github.com/adoroszlai/ozone/actions/runs/28229850840/job/83631071973

@adoroszlai adoroszlai self-assigned this Jun 26, 2026
@adoroszlai adoroszlai requested review from Russole and szetszwo June 26, 2026 10:01

@Russole Russole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @adoroszlai for working on this. LGTM!

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch. Changes LGTM

@szetszwo szetszwo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 the change looks good. Thanks for fixing this!

@adoroszlai adoroszlai merged commit 8df9cfb into apache:master Jun 27, 2026
33 checks passed
@adoroszlai adoroszlai deleted the HDDS-15689 branch June 27, 2026 06:20
@adoroszlai

Copy link
Copy Markdown
Contributor Author

Thanks @priyeshkaratha, @Russole, @szetszwo for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants