belliottsmith commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1108348469


##########
src/java/org/apache/cassandra/cql3/QueryOptions.java:
##########
@@ -53,6 +54,10 @@
 
     public static final CBCodec<QueryOptions> codec = new Codec();
 
+    private static final int UNSET_NOWINSEC = Integer.MIN_VALUE;
+    // Guava uint counterpart to the above for serialization purposes. This 
imposes a year 2186 max value
+    private static final int UNSET_NOWINSEC_GUAVA_UINT = 
UnsignedInteger.MAX_VALUE.intValue() - 1;

Review Comment:
   This is not a good reason. This simply makes it look like we _do_ have some 
other sentinel value to future readers of the code, who will go hunting for one 
and fail to find it. Equally there can be more than one sentinel value - 
indeed, we have just introduced another one here! 
   
   The only valid approach to sentinels is to be sure you know what they all 
are, assign them logically, and document them clearly. Padding your sentinels 
and hoping not to collide is just asking for problems, even more so if everyone 
followed this logic.



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