belliottsmith commented on code in PR #1951:
URL: https://github.com/apache/cassandra/pull/1951#discussion_r1014286381


##########
src/java/org/apache/cassandra/service/accord/db/AccordUpdate.java:
##########
@@ -766,7 +769,54 @@ public Write apply(Data data)
         return new AccordWrite(new ArrayList<>(updateMap.values()));
     }
 
-    UpdatePredicate getPredicate(int i)
+    @Override
+    public Update slice(KeyRanges ranges)
+    {
+        Keys keys = this.keys.slice(ranges);
+        return new AccordUpdate(keys, select(this.keys, keys, updates), 
select(this.keys, keys, predicates));
+    }
+
+    private static ByteBuffer[] select(Keys in, Keys out, ByteBuffer[] from)
+    {
+        ByteBuffer[] result = new ByteBuffer[out.size()];
+        int j = 0;
+        for (int i = 0 ; i < in.size() ; ++i)
+        {
+            j = in.findNext(out.get(i), j);
+            result[i] = from[j];
+        }
+        return result;
+    }
+
+    @Override
+    public Update merge(Update update)
+    {
+        // TODO: special method for linear merging keyed and non-keyed lists 
simultaneously

Review Comment:
   i.e. we have an array of keys, and another array of non-keys that correspond 
to the keys.



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