wuchenxi123 commented on a change in pull request #11112: URL: https://github.com/apache/pulsar/pull/11112#discussion_r659875261
########## File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstance.java ########## @@ -74,6 +75,24 @@ public JavaInstance(ContextImpl contextImpl, Object userClassObject, InstanceCon } } + public void setup() { + if (null != function && function instanceof Hook) { + try { + ((Hook) function).preProcess(context); + } catch (RuntimeException e) { + log.error("setup error:", e); + throw new RuntimeException("function preProcess occurred exception", e); + } + } + if (null != javaUtilFunction && javaUtilFunction instanceof Hook) { Review comment: I have corrected it -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org