pratt4 commented on code in PR #25868:
URL: https://github.com/apache/pulsar/pull/25868#discussion_r3312808177


##########
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functions/FunctionUtils.java:
##########
@@ -42,6 +46,17 @@ public class FunctionUtils {
 
     private static final String PULSAR_IO_SERVICE_NAME = "pulsar-io.yaml";
 
+    /**
+     * Computes MD5 digest of a file as lower-case hex (for function archive 
identity on reload).
+     */
+    public static String computeArchiveMd5Hex(Path path) throws IOException {
+        return calculateMd5Hex(path.toAbsolutePath().normalize().toFile());
+    }
+
+    private static String calculateMd5Hex(File file) throws IOException {
+        return HexFormat.of().formatHex(FileUtils.calculateMd5sum(file));

Review Comment:
   @lhotari 
   should i keep this PR focused on the functions incremental reload change and 
leave the shared utility extraction out of scope??
   
   If needed, I can follow up with a separate issue/PR to extract the common 
helper into `org.apache.pulsar.functions.utils`.
   
   Apart from that, is there any other changes ??
   
    thanks !



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to