belliottsmith commented on code in PR #6:
URL: https://github.com/apache/cassandra-accord/pull/6#discussion_r944412677
##########
accord-core/src/main/java/accord/local/Command.java:
##########
@@ -224,22 +224,19 @@ public boolean commit(Txn txn, Key homeKey, Key
progressKey, Timestamp executeAt
this.waitingOnCommit = new TreeMap<>();
this.waitingOnApply = new TreeMap<>();
- for (TxnId id : savedDeps().on(commandStore, executeAt))
- {
- Command command = commandStore.command(id);
+ savedDeps().forEachOn(commandStore, executeAt, txnId -> {
+ Command command = commandStore.command(txnId);
switch (command.status)
{
default:
throw new IllegalStateException();
case NotWitnessed:
- Txn depTxn = savedDeps().get(id);
- command.txn(depTxn);
case PreAccepted:
case Accepted:
case AcceptedInvalidate:
// we don't know when these dependencies will execute, and
cannot execute until we do
- waitingOnCommit.put(id, command);
command.addListener(this);
+ waitingOnCommit.put(txnId, command);
Review Comment:
Probably just that it makes a kind of sense to ensure the listener is
registered before we block execution on its membership of the collection, so we
ensure the collection is maintained (though if there are no errors the two
should be equivalent)
--
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]