adelapena commented on code in PR #2436:
URL: https://github.com/apache/cassandra/pull/2436#discussion_r1259539805


##########
src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:
##########
@@ -488,6 +501,16 @@ public DataType getCqlType()
         return cqlType;
     }
 
+    /**
+     * Checks if all values are of fixed length.
+     *
+     * @return {@code true} if all values are of fixed length, {@code false} 
otherwise.
+     */
+    public boolean isValueLengthFixed()

Review Comment:
   I think that would create a multiple inheritance problem. For example, 
`PrimitiveLongCodec` extends `TypeCodec` and has multiple subclasses with both 
fixed and variable encoding. Those subclasses can't inherit from both 
`PrimitiveLongCodec` and the proposed Fixed/Variable classes. 
   
   Alternatively, we could make a separate interface just for the 
`isValueLengthFixed ` method and make `TypeCodec` implement it. That interface 
would be extended by two Fixed/Variable interfaces with default 
implementations, and the terminal subclasses of `TypeCodec` would implement 
them. 
   
   However, I find that adds too much complexity for a single boolean method. I 
prefer the current approach, which is identical to the one used in 
`AbstractType#valueLengthIfFixed` et al.



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