belliottsmith commented on code in PR #203:
URL: https://github.com/apache/cassandra-accord/pull/203#discussion_r2142219514


##########
accord-core/src/main/java/accord/local/CommandStores.java:
##########
@@ -715,49 +760,144 @@ protected <O> Cancellable 
mapReduceConsume(PreLoadContext context, Unseekables<?
         return reduced.begin(mapReduceConsume);
     }
 
+    protected <O> Cancellable mapReduceConsume(PreLoadContext context, 
StoreSelector selector, MapReduceConsume<? super SafeCommandStore, O> 
mapReduceConsume)
+    {
+        AsyncChain<O> reduced = mapReduce(context, selector, mapReduceConsume);
+        return reduced.begin(mapReduceConsume);
+    }
+
     public  <O> Cancellable mapReduceConsume(PreLoadContext context, IntStream 
commandStoreIds, MapReduceConsume<? super SafeCommandStore, O> mapReduceConsume)
     {
         AsyncChain<O> reduced = mapReduce(context, commandStoreIds, 
mapReduceConsume);
         return reduced.begin(mapReduceConsume);
     }
 
-    private static class StoreSelector extends SimpleBitSet implements 
IndexedQuadConsumer<Object, Object, Object, Object>, 
IndexedRangeQuadConsumer<Object, Object, Object, Object>
+    public static class NoStoreSelector implements StoreSelector
+    {
+        private static final NoStoreSelector INSTANCE = new NoStoreSelector();
+
+        @Override
+        public StoreSelector refine(TxnId txnId, @Nullable Timestamp 
executeAt, Participants<?> participants)
+        {
+            return snapshot -> StoreFinder.find(snapshot, participants)
+                                          .filter(snapshot, participants, 
txnId.epoch(), (executeAt != null ? executeAt : txnId).epoch())
+                                          .iterator(snapshot);
+        }
+
+        @Override
+        public Iterator<CommandStore> select(Snapshot snapshot)
+        {
+            throw new UnsupportedOperationException();

Review Comment:
   I have made a last minute change to split out these into two interfaces, so 
we make the transition explicit. We can bike shed naming in post.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to