[
https://issues.apache.org/jira/browse/HDDS-15689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-15689:
----------------------------------
Labels: pull-request-available (was: )
> Compare MD5Hash directly in ScmInvokerCodeGenerator
> ---------------------------------------------------
>
> Key: HDDS-15689
> URL: https://issues.apache.org/jira/browse/HDDS-15689
> Project: Apache Ozone
> Issue Type: Task
> Components: SCM
> Reporter: Attila Doroszlai
> Assignee: Attila Doroszlai
> Priority: Trivial
> Labels: pull-request-available
>
> {code:title=https://github.com/apache/ozone/blob/29b2ad5fcd40642c77f771128e7f0f7c4fe88e42/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/invoker/ScmInvokerCodeGenerator.java#L643-L645}
> final MD5Hash javaMd5 = MD5FileUtil.computeMd5ForFile(java);
> final MD5Hash tmpMd5 = MD5FileUtil.computeMd5ForFile(tmp);
> if (Arrays.equals(javaMd5.getDigest(), tmpMd5.getDigest())) {
> {code}
> {{getDigest()}} returns {{byte[]}} in Ratis 3.2.1, but {{ByteBuffer}} in
> 3.2.2, resulting in compile error:
> {code}
> ScmInvokerCodeGenerator.java:[645,15] no suitable method found for
> equals(java.nio.ByteBuffer,java.nio.ByteBuffer)
> {code}
> {{MD5Hash#equals}} is based on {{digest}} internally, so we can make
> ScmInvokerCodeGenerator work with both versions of Ratis by checking equality
> of {{MD5Hash}} itself.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]