iamaleksey commented on code in PR #2982:
URL: https://github.com/apache/cassandra/pull/2982#discussion_r1450501367


##########
src/java/org/apache/cassandra/journal/Flusher.java:
##########
@@ -181,11 +186,11 @@ private void doFlush()
         }
 
         // flush the segment, schedule write callbacks if requested, return 
whether the segment has been flushed fully
-        private boolean doFlush(ActiveSegment<K> segment, boolean 
scheduleCallbacks)
+        private boolean doFlush(ActiveSegment<K, V> segment, boolean 
scheduleCallbacks)
         {
             int syncedOffset = segment.flush();
             if (scheduleCallbacks)
-                segment.scheduleOnSuccessCallbacks(syncedOffset);
+                callbacks.onFlush(segment.descriptor.timestamp, syncedOffset);
             return segment.isFullyFlushed(syncedOffset);

Review Comment:
   Agreed. Renamed the method to `isCompletedAndFullyFlushed()` and changed the 
logic to break out early if an older segment isn't fully complete and flushed. 
Also to invoke `onFlushed()` callback just once per iteration of the flusher 
instead of once per segment that'd been flushed.



-- 
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]

Reply via email to