yifan-c commented on code in PR #205:
URL: https://github.com/apache/cassandra-sidecar/pull/205#discussion_r1996267402


##########
server/src/main/java/org/apache/cassandra/sidecar/datahub/SchemaReportingTask.java:
##########
@@ -53,38 +53,41 @@ public class SchemaReportingTask implements PeriodicTask, 
ExecuteOnClusterLeaseh
     protected final CQLSessionProvider session;
     @NotNull
     protected final SchemaReporter reporter;
+    @NotNull
+    protected final TaskExecutorPool executor;
 
     public SchemaReportingTask(@NotNull SidecarConfiguration configuration,
                                @NotNull CQLSessionProvider session,
-                               @NotNull SchemaReporter reporter)
+                               @NotNull SchemaReporter reporter,
+                               @NotNull TaskExecutorPool executor)
     {
         this.configuration = configuration.schemaReportingConfiguration();
         this.session = session;
         this.reporter = reporter;
+        this.executor = executor;
     }
 
     @Override
-    public void deploy(Vertx vertx, PeriodicTaskExecutor executor)
+    public void deploy(@NotNull Vertx vertx,
+                       @NotNull PeriodicTaskExecutor executor)
     {
-        // TODO: react on ON_CASSANDRA_CQL_READY instead? When any CQL 
connection is ready, cluster metadata should be available from session
-        EventBusUtils.onceLocalConsumer(vertx.eventBus(), 
ON_ALL_CASSANDRA_CQL_READY.address(), ignored -> executor.schedule(this));
+        EventBusUtils.onceLocalConsumer(vertx.eventBus(),
+                                        
SidecarServerEvents.ON_CASSANDRA_CQL_READY.address(),
+                                        message -> executor.schedule(this));

Review Comment:
   👍 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to