belliottsmith commented on code in PR #150:
URL: https://github.com/apache/cassandra-accord/pull/150#discussion_r1885080970
##########
accord-core/src/main/java/accord/local/cfk/PostProcess.java:
##########
@@ -275,30 +275,54 @@ static NotifyUnmanagedResult notifyUnmanaged(Unmanaged[]
unmanageds,
}
{
- Timestamp applyTo = null;
if (newInfo != null && newInfo.is(APPLIED))
{
TxnInfo maxContiguousApplied =
CommandsForKey.maxContiguousManagedApplied(committedByExecuteAt,
maxAppliedWriteByExecuteAt, bootstrappedAt);
if (maxContiguousApplied != null &&
maxContiguousApplied.compareExecuteAt(newInfo) >= 0)
- applyTo = maxContiguousApplied.executeAt;
- }
- else if (newInfo == null)
- {
- TxnInfo maxContiguousApplied =
CommandsForKey.maxContiguousManagedApplied(committedByExecuteAt,
maxAppliedWriteByExecuteAt, bootstrappedAt);
- if (maxContiguousApplied != null)
- applyTo = maxContiguousApplied.executeAt;
-
- applyTo = Timestamp.nonNullOrMax(applyTo,
TxnId.nonNullOrMax(redundantBefore, bootstrappedAt));
+ {
+ Timestamp applyTo = maxContiguousApplied.executeAt;
+ int start = findFirstApply(unmanageds);
+ int end = findApply(unmanageds, start, applyTo);
+ if (start != end)
+ {
+ TxnId[] notifyNotWaiting = selectUnmanaged(unmanageds,
start, end);
+ unmanageds = removeUnmanaged(unmanageds, start, end);
+ notifier = new PostProcess.NotifyNotWaiting(notifier,
notifyNotWaiting);
+ }
+ }
}
-
- if (applyTo != null)
+ else if (newInfo == null && isNewBoundsInfo)
{
int start = findFirstApply(unmanageds);
- int end = findApply(unmanageds, start, applyTo);
- if (start != end)
+ int end = start;
+ int j = 1 +
maxContiguousManagedAppliedIndex(committedByExecuteAt,
maxAppliedWriteByExecuteAt, bootstrappedAt);
+ while (end < unmanageds.length && j <
committedByExecuteAt.length)
+ {
+ int c =
committedByExecuteAt[j].executeAt.compareTo(unmanageds[end].waitingUntil);
+ if (c == 0)
+ {
+ if (start != end)
+ {
+ TxnId[] notifyNotWaiting =
selectUnmanaged(unmanageds, start, end);
+ unmanageds = removeUnmanaged(unmanageds, start,
end);
+ end -= (end - start);
Review Comment:
Yes, I suppose it is. Logically it made more sense to me to represent it as
deducting the number of removed items. But it also makes sense that we would
reset to the start if we remove from there to our current pointer.
--
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]