aweisberg commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1063764588
##########
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:
##########
@@ -210,13 +230,51 @@ public static ColumnCondition condition(ColumnMetadata
column, FieldIdentifier u
return new UDTFieldCondition(column, udtField, op, terms);
}
+ /*
+ * Don't change or remove entries (and ordinals) or it will break cross
version compatibility
+ * as the ordinals are sent in messages and stored by Accord for in flight
transactions
+ */
+ enum BoundKind
+ {
+ ELEMENT_ACCESS,
+ MULTI_CELL_COLLECTION,
+ MULTI_CELL_UDT,
+ SIMPLE,
+ UDT_FIELD_ACCESS;
+
+ @SuppressWarnings("rawtypes")
+ BoundSerializer serializer()
+ {
+ switch(this)
+ {
+ case ELEMENT_ACCESS:
+ return ElementAccessBound.serializer;
+ case MULTI_CELL_COLLECTION:
+ return MultiCellCollectionBound.serializer;
+ case MULTI_CELL_UDT:
+ return MultiCellUdtBound.serializer;
+ case SIMPLE:
+ return SimpleBound.serializer;
+ case UDT_FIELD_ACCESS:
+ return UDTFieldAccessBound.serializer;
+ default:
+ throw new AssertionError("Shouldn't have an enum with no
serializer");
+ }
+ }
+ }
Review Comment:
Yeah changed to this as part of the previous thing. I didn't do this because
it requires expressing the relationship twice. Once for ID and once for when
you already have an enum value.
The ordinal gives you that for free, but then it's unsafe.
--
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]