belliottsmith commented on code in PR #113:
URL: https://github.com/apache/cassandra-accord/pull/113#discussion_r1746058269
##########
accord-core/src/main/java/accord/local/cfk/PostProcess.java:
##########
@@ -153,22 +190,46 @@ void doNotify(SafeCommandStore safeStore, Key key,
NotifySink notifySink)
if (!addUnmanageds.isEmpty())
{
CommandsForKey cur = safeCfk.current();
- addUnmanageds.sort(CommandsForKey.Unmanaged::compareTo);
- CommandsForKey.Unmanaged[] newUnmanageds =
addUnmanageds.toArray(new CommandsForKey.Unmanaged[0]);
- newUnmanageds = SortedArrays.linearUnion(cur.unmanageds, 0,
cur.unmanageds.length, newUnmanageds, 0, newUnmanageds.length,
CommandsForKey.Unmanaged::compareTo,
ArrayBuffers.uncached(CommandsForKey.Unmanaged[]::new));
+ addUnmanageds.sort(Unmanaged::compareTo);
+ Unmanaged[] newUnmanageds = addUnmanageds.toArray(new
Unmanaged[0]);
+ newUnmanageds = SortedArrays.linearUnion(cur.unmanageds, 0,
cur.unmanageds.length, newUnmanageds, 0, newUnmanageds.length,
Unmanaged::compareTo, ArrayBuffers.uncached(Unmanaged[]::new));
safeCfk.set(cur.update(newUnmanageds));
}
+
+ for (PostProcess postProcess : nestedNotify)
+ postProcess.postProcess(safeStore, key, notifySink);
+ }
+ }
+
+
+ static class NotifyUnmanagedResult
+ {
+ final Unmanaged[] newUnmanaged;
+ final PostProcess postProcess;
+
+ NotifyUnmanagedResult(Unmanaged[] newUnmanaged, PostProcess
postProcess)
+ {
+ this.newUnmanaged = newUnmanaged;
+ this.postProcess = postProcess;
}
}
- static CommandsForKeyUpdate notifyUnmanaged(CommandsForKey cfk, @Nullable
TxnInfo curInfo, TxnInfo newInfo)
+ static NotifyUnmanagedResult notifyUnmanaged(Unmanaged[] unmanageds,
Review Comment:
The difference is only that we do not pass the `cfk` so we can notify before
constructing the `cfk` and apply stricter integrity checking as a result.
--
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]