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: [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]