vinothchandar commented on a change in pull request #1350: [HUDI-629]: Replace 
Guava's Hashing with an equivalent in NumericUtils.java
URL: https://github.com/apache/incubator-hudi/pull/1350#discussion_r392321048
 
 

 ##########
 File path: 
hudi-common/src/main/java/org/apache/hudi/common/util/NumericUtils.java
 ##########
 @@ -31,4 +38,28 @@ public static String humanReadableByteCount(double bytes) {
     String pre = "KMGTPE".charAt(exp - 1) + "";
     return String.format("%.1f %sB", bytes / Math.pow(1024, exp), pre);
   }
+
+  public static long getMessageDigestHash(final String algorithmName, final 
String string) {
+    MessageDigest md;
+    try {
+      md = MessageDigest.getInstance(algorithmName);
+    } catch (NoSuchAlgorithmException e) {
+      throw new HoodieException(e);
+    }
+    byte[] bytes = 
Objects.requireNonNull(md).digest(string.getBytes(StandardCharsets.UTF_8));
 
 Review comment:
   combine return and `bytes` assignment lines? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to