hailin0 commented on code in PR #3469:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3469#discussion_r1027039333


##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/Handover.java:
##########
@@ -20,24 +20,47 @@
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.io.Closeable;
+import java.util.ArrayDeque;
 import java.util.Optional;
-import java.util.concurrent.LinkedBlockingQueue;
+import java.util.Queue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 public final class Handover<T> implements Closeable {
-    private final Object lock = new Object();
-    private final LinkedBlockingQueue<T> blockingQueue =
-        new LinkedBlockingQueue<>();
+    private static final int DEFAULT_QUEUE_SIZE = 8192;
+    private static final long DEFAULT_POLL_INTERVAL_MILLIS = 200;
+
+    private final Lock lock;
+    private final Condition isNotFull;
+    private final Queue<T> queue;
     private Throwable error;
 
+    public Handover() {
+        this.lock = new ReentrantLock();
+        this.isNotFull = lock.newCondition();
+
+        this.queue = new ArrayDeque<>(DEFAULT_QUEUE_SIZE);

Review Comment:
   Why not use `ArrayBlockingQueue`?
   
   



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