aweisberg commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1063737604
##########
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:
##########
@@ -445,33 +585,81 @@ private static int getListIndex(ByteBuffer
collectionElement)
checkFalse(idx < 0, "Invalid negative list index %d", idx);
return idx;
}
+
+ @Override
+ protected BoundKind kind()
+ {
+ return BoundKind.ELEMENT_ACCESS;
+ }
+
+ private static final BoundSerializer<ElementAccessBound> serializer =
new BoundSerializer<ElementAccessBound>()
+ {
+ @Override
+ public void serialize(ElementAccessBound bound, DataOutputPlus
out, int version) throws IOException
+ {
+ vintSerializer.serialize(bound.collectionElement, out,
version);
+ serializeList(bound.values, out, version,
vintNullableSerializer);
+ }
+
+ @Override
+ public ElementAccessBound deserialize(DataInputPlus in, int
version, ColumnMetadata column, Operator operator) throws IOException
+ {
+ ByteBuffer collectionElement = vintSerializer.deserialize(in,
version);
+ List<ByteBuffer> values = deserializeList(in, version,
vintNullableSerializer);
+ return new ElementAccessBound(column, collectionElement,
operator, values);
+ }
+
+ @Override
+ public long serializedSize(ElementAccessBound bound , int version)
+ {
+ return vintSerializer.serializedSize(bound.collectionElement,
version) + serializedListSize(bound.values, version, vintNullableSerializer);
+ }
+ };
}
/**
* A condition on an entire collection column.
*/
public static final class MultiCellCollectionBound extends Bound
{
- private final List<Term.Terminal> values;
+ @Nonnull
+ private final List<Terminal> values;
+
+ @Nullable
+ private Supplier<List<ByteBuffer>> serializedValues;
Review Comment:
Yes, I think that was the reason. I will add a comment.
--
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]