lukasz-antoniak commented on code in PR #340:
URL: https://github.com/apache/cassandra-sidecar/pull/340#discussion_r3182002433


##########
server/src/main/java/org/apache/cassandra/sidecar/modules/ConfigurationModule.java:
##########
@@ -126,6 +133,25 @@ CQLSessionProvider cqlSessionProvider(Vertx vertx,
         return cqlSessionProvider;
     }
 
+    @Provides
+    @Singleton
+    DriverUnsupportedSchemaCache driverUnsupportedSchemaCache(Vertx vertx,
+                                                              
SidecarConfiguration sidecarConfiguration,
+                                                              
CQLSessionProvider cqlSessionProvider)
+    {
+        DriverUnsupportedSchemaCache schemaCache = new 
DriverUnsupportedSchemaCache(sidecarConfiguration, cqlSessionProvider);
+        // trigger immediate cache population once Sidecar connects to 
Cassandra node
+        EventBusUtils.onceLocalConsumer(vertx.eventBus(), 
ON_CASSANDRA_CQL_READY.address(), ignored -> schemaCache.refresh(true));

Review Comment:
   `DriverUnsupportedSchemaCache` is already registered as periodic task and 
executed in fixed intervals. Tested it locally. I have wrapped execution with 
`vertx.executeBlocking(...)`. Thanks for pointing this one.



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