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 2021/08/30 01:54:13 UTC

[GitHub] [pulsar] gaoran10 commented on a change in pull request #11831: [pulsar-functions] Pass `SubscriptionPosition` from `FunctionDetails` to `FunctionConfig` / `SinkConfig`

gaoran10 commented on a change in pull request #11831:
URL: https://github.com/apache/pulsar/pull/11831#discussion_r698113364



##########
File path: pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java
##########
@@ -373,6 +373,15 @@ public static FunctionConfig convertFromDetails(FunctionDetails functionDetails)
 
         functionConfig.setCleanupSubscription(functionDetails.getSource().getCleanupSubscription());
         functionConfig.setAutoAck(functionDetails.getAutoAck());
+
+        // Set subscription position
+        Function.SubscriptionPosition subPosition = functionDetails.getSource().getSubscriptionPosition();
+        if (subPosition == Function.SubscriptionPosition.EARLIEST) {

Review comment:
       Could you make the `Function.SubscriptionPosition.EARLIEST` before the equal symbol? Or use the equal method.
   
   ```
   Function.SubscriptionPosition.EARLIEST == subPosition
   ```
   
   or
   
   ```
   Function.SubscriptionPosition.EARLIEST.equals(subPosition)
   ```
   




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