aweisberg commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1280895299
##########
accord-core/src/main/java/accord/local/Command.java:
##########
@@ -685,25 +819,27 @@ public Ballot accepted()
public static class Committed extends Accepted
{
- private final ImmutableSortedSet<TxnId> waitingOnCommit;
- private final ImmutableSortedMap<Timestamp, TxnId> waitingOnApply;
+ public final WaitingOn waitingOn;
- private Committed(CommonAttributes common, SaveStatus status,
Timestamp executeAt, Ballot promised, Ballot accepted,
ImmutableSortedSet<TxnId> waitingOnCommit, ImmutableSortedMap<Timestamp, TxnId>
waitingOnApply)
+ // Empty constructor for size measurement
+ private Committed(SaveStatus status)
{
- super(common, status, executeAt, promised, accepted);
- this.waitingOnCommit = waitingOnCommit;
- this.waitingOnApply = waitingOnApply;
+ super(Mutable.EMPTY_ATTRS, status, null, null, null);
+ this.waitingOn = WaitingOn.EMPTY;
}
private Committed(CommonAttributes common, SaveStatus status,
Timestamp executeAt, Ballot promised, Ballot accepted, WaitingOn waitingOn)
{
- this(common, status, executeAt, promised, accepted,
waitingOn.waitingOnCommit, waitingOn.waitingOnApply);
+ super(common, status, executeAt, promised, accepted);
+ this.waitingOn = waitingOn;
+ Invariants.checkState(common.route().kind().isFullRoute());
+ Invariants.checkState(waitingOn.deps.equals(common.partialDeps()));
Review Comment:
Huh, that invariants method allocates an array every time for the varargs
unless it gets inlined? Doesn't seem great for performance.
Or is there something I don't know?
--
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]