belliottsmith commented on code in PR #1951:
URL: https://github.com/apache/cassandra/pull/1951#discussion_r1014238339
##########
src/java/org/apache/cassandra/service/accord/async/AsyncWriter.java:
##########
@@ -226,21 +227,38 @@ private void denormalize(AccordCommand command,
AsyncContext context, Object cal
// notify commands we're waiting on that they need to update the
summaries in our maps
if (command.waitingOnCommit.hasModifications())
+ {
denormalizeBlockedOn(command, context, cmd -> cmd.waitingOnCommit,
cmd -> cmd.blockingCommitOn);
+ }
if (command.waitingOnApply.hasModifications())
- denormalizeBlockedOn(command, context, cmd -> cmd.waitingOnApply,
cmd -> cmd.blockingApplyOn);
+ {
+ denormalizeBlockedOn(command, context, cmd -> new
StoredSet.Changes<TxnId>()
+ {
+ @Override
+ public void forEachAddition(Consumer<TxnId> consumer)
+ {
+ cmd.waitingOnApply.forEachAddition((ignore, txnId) ->
consumer.accept(txnId));
+ }
+
+ @Override
+ public void forEachDeletion(Consumer<TxnId> consumer)
+ {
+ cmd.waitingOnApply.forEachDeletion((ignore, txnId) ->
consumer.accept(txnId));
+
+ }
+ }, cmd -> cmd.blockingApplyOn);
+ }
if (command.shouldUpdateDenormalizedWaitingOn())
{
- ByteBuffer summary =
AccordPartialCommand.serializer.serialize(command);
- denormalizeWaitingOnSummaries(command, context, summary, cmd ->
cmd.waitingOnCommit, cmd -> cmd.blockingCommitOn);
- denormalizeWaitingOnSummaries(command, context, summary, cmd ->
cmd.waitingOnApply, cmd -> cmd.blockingApplyOn);
+ denormalizeWaitingOnSummaries(command, context, cmd -> (txnId,
ignore) -> cmd.waitingOnCommit.blindAdd(txnId), cmd -> cmd.blockingCommitOn);
Review Comment:
Yep
--
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]