ppkarwasz commented on code in PR #2112:
URL: https://github.com/apache/logging-log4j2/pull/2112#discussion_r1432552233


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEventHandler.java:
##########
@@ -26,59 +25,12 @@
  * controlled by the {@code Executor} passed to the {@code Disruptor}
  * constructor.
  */
-public class RingBufferLogEventHandler implements 
SequenceReportingEventHandler<RingBufferLogEvent>, LifecycleAware {
-
-    private static final int NOTIFY_PROGRESS_THRESHOLD = 50;
-    private Sequence sequenceCallback;
-    private int counter;
-    private long threadId = -1;
-
-    @Override
-    public void setSequenceCallback(final Sequence sequenceCallback) {
-        this.sequenceCallback = sequenceCallback;
-    }
-
-    @Override
-    public void onEvent(final RingBufferLogEvent event, final long sequence, 
final boolean endOfBatch)
-            throws Exception {
-        try {
-            // RingBufferLogEvents are populated by an EventTranslator. If an 
exception is thrown during event
-            // translation, the event may not be fully populated, but 
Disruptor requires that the associated sequence
-            // still be published since a slot has already been claimed in the 
ring buffer. Ignore any such unpopulated
-            // events. The exception that occurred during translation will 
have already been propagated.
-            if (event.isPopulated()) {
-                event.execute(endOfBatch);
-            }
-        } finally {
-            event.clear();
-            // notify the BatchEventProcessor that the sequence has progressed.
-            // Without this callback the sequence would not be progressed
-            // until the batch has completely finished.
-            notifyCallback(sequence);
-        }
-    }
-
-    private void notifyCallback(final long sequence) {
-        if (++counter > NOTIFY_PROGRESS_THRESHOLD) {
-            sequenceCallback.set(sequence);
-            counter = 0;
-        }
-    }
+public class RingBufferLogEventHandler extends RingBufferLogEventHandler4
+        implements SequenceReportingEventHandler<RingBufferLogEvent>, 
LifecycleAware {
 
     /**
-     * Returns the thread ID of the background consumer thread, or {@code -1} 
if the background thread has not started
-     * yet.
-     * @return the thread ID of the background consumer thread, or {@code -1}
+     * @deprecated Use the {@link RingBufferLogEventHandler4#create()} factory 
method instead.
      */
-    public long getThreadId() {
-        return threadId;
-    }
-
-    @Override
-    public void onStart() {
-        threadId = Thread.currentThread().getId();
-    }
-
-    @Override
-    public void onShutdown() {}
+    @Deprecated
+    public RingBufferLogEventHandler() {}

Review Comment:
   I ended up deprecating the whole class for "removal" in 3.x without 
replacement.
   
   Deprecation is the only technical reason for the minor version bump, so I 
added a changelog entry that we can always remove later.



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

Reply via email to