blerer commented on code in PR #2655:
URL: https://github.com/apache/cassandra/pull/2655#discussion_r1447325011
##########
src/java/org/apache/cassandra/db/marshal/MapType.java:
##########
@@ -398,4 +375,37 @@ public ByteBuffer getMaskedValue()
{
return decompose(Collections.emptyMap());
}
+
+ @Override
+ public List<ByteBuffer> filterSortAndValidateElements(List<ByteBuffer>
buffers)
+ {
+ // We depend on Maps to be properly sorted by their keys, so use a
sorted map implementation here.
+ SortedMap<ByteBuffer, ByteBuffer> map = new TreeMap<>(getKeysType());
+ Iterator<ByteBuffer> iter = buffers.iterator();
+ while (iter.hasNext())
+ {
+ ByteBuffer keyBytes = iter.next();
+ ByteBuffer valueBytes = iter.next();
+
+ if (keyBytes == null)
+ throw new MarshalException("null is not supported inside
collections");
+
+ getKeysType().validate(keyBytes);
+
+ if (valueBytes == null)
+ throw new MarshalException("null is not supported inside
collections");
+
+ getValuesType().validate(valueBytes);
+
Review Comment:
Changed
--
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]