aweisberg commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1063726202


##########
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:
##########
@@ -579,6 +775,43 @@ private static boolean mapAppliesTo(MapType<?, ?> type, 
Iterator<Cell<?>> iter,
             // they're equal
             return operator == Operator.EQ || operator == Operator.LTE || 
operator == Operator.GTE;
         }
+
+        @Override
+        protected BoundKind kind()
+        {
+            return BoundKind.MULTI_CELL_COLLECTION;
+        }
+
+        private static final BoundSerializer<MultiCellCollectionBound> 
serializer = new BoundSerializer<MultiCellCollectionBound>()
+        {
+            @Override
+            public void serialize(MultiCellCollectionBound bound, 
DataOutputPlus out, int version) throws IOException
+            {
+                serializeList(bound.serializedValues().get(), out, version, 
vintNullableSerializer);
+            }
+
+            @Override
+            public MultiCellCollectionBound deserialize(DataInputPlus in, int 
version, ColumnMetadata column, Operator operator) throws IOException
+            {
+                List<ByteBuffer> values = deserializeList(in, version, 
vintNullableSerializer);
+                List<Terminal> terminals;
+                if (operator.isContains() || operator.isContainsKey())
+                {
+                    terminals = 
values.stream().map(Constants.Value::new).collect(toList());

Review Comment:
   If you really want to think performance... the array list is just a list of 
objects and if it were mutable we could just replace each element with what we 
want :-P
   
   The mistake is actually that deserialize list is not a stream (and streams 
are not efficient in their own right).
   
   



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