Jason918 commented on a change in pull request #13498:
URL: https://github.com/apache/pulsar/pull/13498#discussion_r775127086



##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowManager.java
##########
@@ -105,7 +105,9 @@ public void add(T event, long ts, Record<?> record) {
     public void add(Event<T> windowEvent) {
         // watermark events are not added to the queue.
         if (windowEvent.isWatermark()) {
-            log.debug(String.format("Got watermark event with ts %d", 
windowEvent.getTimestamp()));
+            if (log.isDebugEnabled()) {
+                log.debug(String.format("Got watermark event with ts %d", 
windowEvent.getTimestamp()));

Review comment:
       No need to use String.format, just 
   log.debug("Got watermark event with ts {}", windowEvent.getTimestamp());
   

##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowManager.java
##########
@@ -145,8 +147,10 @@ public boolean onTrigger() {
         prevWindowEvents.clear();
         if (!events.isEmpty()) {
             prevWindowEvents.addAll(windowEvents);
-            log.debug(String.format("invoking windowLifecycleListener 
onActivation, [%d] events in "
-                    + "window.", events.size()));
+            if (log.isDebugEnabled()) {
+                log.debug(String.format("invoking windowLifecycleListener 
onActivation, [%d] events in "

Review comment:
       Same here

##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowManager.java
##########
@@ -216,7 +220,9 @@ private void track(Event<T> windowEvent) {
             lock.unlock();
         }
         eventsSinceLastExpiry.set(0);
-        log.debug(String.format("[%d] events expired from window.", 
eventsToExpire.size()));
+        if (log.isDebugEnabled()) {
+            log.debug(String.format("[%d] events expired from window.", 
eventsToExpire.size()));

Review comment:
       Same here.




-- 
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