frankgh commented on code in PR #238:
URL: https://github.com/apache/cassandra-sidecar/pull/238#discussion_r2229119155


##########
adapters/adapters-base/src/main/java/org/apache/cassandra/sidecar/adapters/base/db/ConnectedClientStatsDatabaseAccessor.java:
##########
@@ -55,7 +57,7 @@ public ConnectedClientStatsSummary summary()
      */
     public Stream<ConnectedClientStats> stats()
     {
-        tableSchema.prepareStatements(session());
+        Preconditions.checkState(tableSchema.isInitialized(), 
tableSchema.getClass().getSimpleName() + " is not initialized yet");

Review Comment:
   Ditto:
   ```suggestion
           Preconditions.checkState(tableSchema.isInitialized(), () -> 
tableSchema.getClass().getSimpleName() + " is not initialized yet");
   ```



##########
adapters/adapters-base/src/main/java/org/apache/cassandra/sidecar/adapters/base/db/ConnectedClientStatsDatabaseAccessor.java:
##########
@@ -43,7 +45,7 @@ public 
ConnectedClientStatsDatabaseAccessor(CQLSessionProvider sessionProvider,
      */
     public ConnectedClientStatsSummary summary()
     {
-        tableSchema.prepareStatements(session());
+        Preconditions.checkState(tableSchema.isInitialized(), 
tableSchema.getClass().getSimpleName() + " is not initialized yet");

Review Comment:
   NIT : avoid string concat for the happy path:
   ```suggestion
           Preconditions.checkState(tableSchema.isInitialized(), () -> 
tableSchema.getClass().getSimpleName() + " is not initialized yet");
   ```



##########
adapters/adapters-base/build.gradle:
##########
@@ -52,6 +52,7 @@ dependencies {
     compileOnly('org.jetbrains:annotations:23.0.0')
     compileOnly('com.datastax.cassandra:cassandra-driver-core:3.11.3')
     implementation("org.slf4j:slf4j-api:${project.slf4jVersion}")
+    implementation("com.google.inject:guice:${guiceVersion}")

Review Comment:
   -1 on this. We can always inject it in a module without having to annotate 
it.



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