类 PeekBlockingQueue<E>
java.lang.Object
org.apache.seatunnel.engine.server.utils.PeekBlockingQueue<E>
PeekBlockingQueue implements blocking when peeking. Queues like BlockingQueue only support
blocking when take() is called. The original solution used sleep(2000) to check whether there was
data in the pending queue. This solution still had performance drawbacks, so it was changed to
use peek blocking, which allows tasks to be scheduled more efficiently.
Application scenario: In CoordinatorService, the following process needs to be executed:
1. Peek data from the queue.
2. Check if resources are sufficient.
3. If resources are sufficient, take() the data; otherwise, do not take data from the queue.
-
构造器概要
构造器 -
方法概要
-
构造器详细资料
-
PeekBlockingQueue
public PeekBlockingQueue()
-
-
方法详细资料
-
put
-
take
-
release
public void release() -
peekBlocking
-
size
-