maedhroz commented on a change in pull request #1180:
URL: https://github.com/apache/cassandra/pull/1180#discussion_r702049939



##########
File path: src/java/org/apache/cassandra/db/ReadCommand.java
##########
@@ -86,6 +88,10 @@
     protected static final Logger logger = 
LoggerFactory.getLogger(ReadCommand.class);
     public static final IVersionedSerializer<ReadCommand> serializer = new 
Serializer();
 
+    // Expose the active command running so transitive calls can lookup this 
command.
+    // This is useful for a few reasons, but mainly because the CQL query is 
here.
+    private static final FastThreadLocal<ReadCommand> COMMAND = new 
FastThreadLocal<>();

Review comment:
       My initial reaction to seeing this is to push to avoid the thread-local. 
It seems like there are two pieces of information this transmits: the metadata 
and CQL. If we're willing to downgrade to knowledge of the table and key (which 
I'd say might be good enough for a warning message) we can just pass both of 
those directly to `IndexSerializer#deserialize()`. Doing that would also 
implicitly eliminate the problem of constantly setting and removing the current 
`ReadCommand` for local reads that don't care.
   
   `IndexSerializer` isn't really an external interface, so I don't think those 
changes would be disruptive.




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