You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/11/02 12:55:32 UTC

[GitHub] [cassandra-accord] belliottsmith commented on a diff in pull request #7: CASSANDRA-17109: Partial Transaction Replication

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


##########
accord-core/src/main/java/accord/impl/InMemoryCommandsForKey.java:
##########
@@ -118,20 +135,29 @@ public void updateMax(Timestamp timestamp)
     }
 
     @Override
-    public CommandTimeseries uncommitted()
+    public InMemoryCommandTimeseries<TxnIdWithExecuteAt> uncommitted()
     {
         return uncommitted;
     }
 
     @Override
-    public CommandTimeseries committedById()
+    public InMemoryCommandTimeseries<TxnId> committedById()
     {
         return committedById;
     }
 
     @Override
-    public CommandTimeseries committedByExecuteAt()
+    public InMemoryCommandTimeseries<TxnId> committedByExecuteAt()
     {
         return committedByExecuteAt;
     }
+
+    public void forWitnessed(Timestamp minTs, Timestamp maxTs, Consumer<Command> consumer)
+    {
+        uncommitted().between(minTs, maxTs)
+                .filter(cmd -> cmd.hasBeen(Status.PreAccepted)).forEach(consumer);
+        committedById().between(minTs, maxTs).forEach(consumer);
+        committedByExecuteAt().between(minTs, maxTs)

Review Comment:
   Yes, but perhaps keyed by different times, so they may only overlap with the range in one of the two collections



-- 
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-unsubscribe@cassandra.apache.org

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


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