jeffkbkim commented on code in PR #15430:
URL: https://github.com/apache/kafka/pull/15430#discussion_r1503396742


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/runtime/MultiThreadedEventProcessorTest.java:
##########
@@ -53,53 +50,19 @@
 
 @Timeout(value = 60)
 public class MultiThreadedEventProcessorTest {
-    private static class MockEventAccumulator<T> extends 
EventAccumulator<TopicPartition, CoordinatorEvent> {
+    private static class DelayEventAccumulator extends 
EventAccumulator<TopicPartition, CoordinatorEvent> {
         private final Time time;
-        private final Queue<CoordinatorEvent> events;
-        private final long timeToPollMs;
-        private final AtomicBoolean isClosed;
+        private final long takeDelayMs;
 
-        public MockEventAccumulator(Time time, long timeToPollMs) {
+        public DelayEventAccumulator(Time time, long takeDelayMs) {
             this.time = time;
-            this.events = new LinkedList<>();
-            this.timeToPollMs = timeToPollMs;
-            this.isClosed = new AtomicBoolean(false);
+            this.takeDelayMs = takeDelayMs;
         }
 
         @Override
-        public CoordinatorEvent poll() {
-            synchronized (events) {
-                while (events.isEmpty() && !isClosed.get()) {
-                    try {
-                        events.wait();
-                    } catch (Exception ignored) {
-                        
-                    }
-                }
-                time.sleep(timeToPollMs);
-                return events.poll();
-            }
-        }
-
-        @Override
-        public CoordinatorEvent poll(long timeout, TimeUnit unit) {
-            return null;
-        }
-
-        @Override
-        public void add(CoordinatorEvent event) throws 
RejectedExecutionException {
-            synchronized (events) {
-                events.add(event);
-                events.notifyAll();
-            }
-        }
-
-        @Override
-        public void close() {
-            isClosed.set(true);
-            synchronized (events) {
-                events.notifyAll();
-            }
+        public CoordinatorEvent take() {

Review Comment:
   thanks for the simplification!



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to