You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/12 05:49:16 UTC

[GitHub] [pulsar] Technoboy- commented on a diff in pull request #15491: [improve][connector] Sink support custom acknowledge type

Technoboy- commented on code in PR #15491:
URL: https://github.com/apache/pulsar/pull/15491#discussion_r870971289


##########
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/SinkRecord.java:
##########
@@ -82,6 +83,20 @@ public void ack() {
         sourceRecord.ack();
     }
 
+    /**
+     * Some sink sometimes wants to control the ack type.
+     *
+     * @param cumulative
+     */
+    public void ack(boolean cumulative) {
+        if (sourceRecord instanceof PulsarRecord) {
+            PulsarRecord pulsarRecord = (PulsarRecord) sourceRecord;
+            pulsarRecord.ack(cumulative);
+        } else {
+            throw new RuntimeException("SourceRecord class type must equals PulsarRecord");

Review Comment:
   `must equals` -> `must be` ?



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org