ifesdjeen commented on code in PR #3431:
URL: https://github.com/apache/cassandra/pull/3431#discussion_r1688038870
##########
src/java/org/apache/cassandra/journal/Journal.java:
##########
@@ -112,31 +116,92 @@ public class Journal<K, V> implements Shutdownable
private final WaitQueue segmentPrepared = newWaitQueue();
private final WaitQueue allocatorThreadWaitQueue = newWaitQueue();
private final BooleanSupplier allocatorThreadWaitCondition = () ->
(availableSegment == null);
+ private final FlusherCallbacks flusherCallbacks;
SequentialExecutorPlus closer;
//private final Set<Descriptor> invalidations =
Collections.newSetFromMap(new ConcurrentHashMap<>());
+ private class FlusherCallbacks implements Flusher.Callbacks
+ {
+ private final Queue<WaitingFor> waitingFor = new
ConcurrentLinkedQueue<>();
+
+ @Override
+ public void onFlush(long segment, int position)
+ {
+ Iterator<WaitingFor> iter = waitingFor.iterator();
Review Comment:
Switched to MPSC queue, and added an array for draining. Will do a bigger
improvement that will introduce callbacks native to Journal in a follow-up.
--
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]