lukasz-antoniak commented on code in PR #2037:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2037#discussion_r2318831235


##########
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java:
##########
@@ -139,7 +142,11 @@ protected CqlRequestHandler(
       String sessionLogPrefix) {
 
     this.startTimeNanos = System.nanoTime();
-    this.logPrefix = sessionLogPrefix + "|" + this.hashCode();
+    this.requestIdGenerator = context.getRequestIdGenerator();

Review Comment:
   If we provide default request ID generator implementation (that matches 
current log prefix), we will not need to do if-else statements to check if 
value is present.
   ```
   this.requestIdGenerator = context.getRequestIdGenerator().orElse(new 
RequestIdGenerator() {
     @Override
     public String getSessionRequestId(@NonNull Request statement) {
       return sessionLogPrefix + "|" + CqlRequestHandler.this.hashCode();
     }
   
     @Override
     public String getNodeRequestId(@NonNull Request statement, @NonNull String 
sessionRequestId, int executionCount) {
       return sessionRequestId;
     }
   });
   ```



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