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


##########
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java:
##########
@@ -125,22 +128,33 @@ public class CqlRequestHandler implements Throttled {
   private final List<NodeResponseCallback> inFlightCallbacks;
   private final RequestThrottler throttler;
   private final RequestTracker requestTracker;
+  private final Optional<RequestIdGenerator> requestIdGenerator;
   private final SessionMetricUpdater sessionMetricUpdater;
   private final DriverExecutionProfile executionProfile;
 
   // The errors on the nodes that were already tried (lazily initialized on 
the first error).
   // We don't use a map because nodes can appear multiple times.
   private volatile List<Map.Entry<Node, Throwable>> errors;
 
+  private final Joiner logPrefixJoiner = Joiner.on('|');
+  private final String sessionName;
+  private final String sessionId;
+
   protected CqlRequestHandler(
       Statement<?> statement,
       DefaultSession session,
       InternalDriverContext context,
-      String sessionLogPrefix) {
+      String sessionName) {
 
     this.startTimeNanos = System.nanoTime();
-    this.logPrefix = sessionLogPrefix + "|" + this.hashCode();
-    LOG.trace("[{}] Creating new handler for request {}", logPrefix, 
statement);
+    this.requestIdGenerator = context.getRequestIdGenerator();
+    this.sessionName = sessionName;
+    this.sessionId =

Review Comment:
   Let's not name this private field `sessionId`. It sounds like the ID of the 
`CqlSession`. How about `sessionRequestId`?



##########
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java:
##########
@@ -267,6 +281,16 @@ private void sendRequest(
         setFinalError(statement, 
AllNodesFailedException.fromErrors(this.errors), null, -1);
       }
     } else {
+      Statement finalStatement = statement;
+      String requestId =

Review Comment:
   Same way, let's call this local var `nodeRequestId'.



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