You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by sa...@apache.org on 2020/07/30 22:01:21 UTC

[pulsar] branch master updated: Call open before discover. This will avoid discover being called before open (#7703)

This is an automated email from the ASF dual-hosted git repository.

sanjeevrk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new bbd5fa1  Call open before discover. This will avoid discover being called before open (#7703)
bbd5fa1 is described below

commit bbd5fa1d14f6f8f18a0d94aaae0ce2ff4413eb18
Author: Sanjeev Kulkarni <sa...@gmail.com>
AuthorDate: Thu Jul 30 15:00:58 2020 -0700

    Call open before discover. This will avoid discover being called before open (#7703)
    
    Co-authored-by: Sanjeev Kulkarni <sa...@splunk.com>
---
 .../src/main/java/org/apache/pulsar/io/batch/BatchSourceExecutor.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-io/batch/src/main/java/org/apache/pulsar/io/batch/BatchSourceExecutor.java b/pulsar-io/batch/src/main/java/org/apache/pulsar/io/batch/BatchSourceExecutor.java
index e624db9..04d87fa 100644
--- a/pulsar-io/batch/src/main/java/org/apache/pulsar/io/batch/BatchSourceExecutor.java
+++ b/pulsar-io/batch/src/main/java/org/apache/pulsar/io/batch/BatchSourceExecutor.java
@@ -122,12 +122,12 @@ public class BatchSourceExecutor<T> implements Source<T> {
     // This is the first thing to do to ensure that any tasks discovered during the discover
     // phase are not lost
     setupInstanceSubscription();
+    batchSource.open(this.config, this.sourceContext);
     if (sourceContext.getInstanceId() == 0) {
       discoveryTriggerer.init(batchSourceConfig.getDiscoveryTriggererConfig(),
                               this.sourceContext);
       discoveryTriggerer.start(this::triggerDiscover);
     }
-    batchSource.open(this.config, this.sourceContext);
   }
 
   private void triggerDiscover(String discoveredEvent) {