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


##########
server/src/main/java/org/apache/cassandra/sidecar/db/schema/SidecarSchema.java:
##########
@@ -49,64 +35,30 @@
 public class SidecarSchema
 {
     private static final Logger LOGGER = 
LoggerFactory.getLogger(SidecarSchema.class);
-    protected static final DurationSpec INITIALIZATION_LOOP_DELAY = 
MillisecondBoundConfiguration.parse("1s");
 
-    private final Vertx vertx;
-    private final PeriodicTaskExecutor periodicTaskExecutor;
     private final SchemaKeyspaceConfiguration schemaKeyspaceConfiguration;
     private final SidecarInternalKeyspace sidecarInternalKeyspace;
-    private final CQLSessionProvider cqlSessionProvider;
-    private final SchemaMetrics metrics;
-    private final ClusterLease clusterLease;
-
-    private boolean isInitialized = false;
+    private final AtomicBoolean isInitialized = new AtomicBoolean(false);
 
     public SidecarSchema(Vertx vertx,
-                         PeriodicTaskExecutor periodicTaskExecutor,
                          SidecarConfiguration config,
-                         SidecarInternalKeyspace sidecarInternalKeyspace,
-                         CQLSessionProvider cqlSessionProvider,
-                         SchemaMetrics metrics,
-                         ClusterLease clusterLease)
+                         SidecarInternalKeyspace sidecarInternalKeyspace)
     {
-        this.vertx = vertx;
-        this.periodicTaskExecutor = periodicTaskExecutor;
         this.schemaKeyspaceConfiguration = 
config.serviceConfiguration().schemaKeyspaceConfiguration();
         this.sidecarInternalKeyspace = sidecarInternalKeyspace;
-        this.cqlSessionProvider = cqlSessionProvider;
-        this.metrics = metrics;
-        this.clusterLease = clusterLease;
         if (this.schemaKeyspaceConfiguration.isEnabled())
         {
-            configureSidecarServerEventListeners();
+            
vertx.eventBus().localConsumer(ON_SIDECAR_SCHEMA_INITIALIZED.address(), ignored 
-> isInitialized.set(true));

Review Comment:
   Yep. Good catch



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to