EricJoy2048 commented on code in PR #5698:
URL: https://github.com/apache/seatunnel/pull/5698#discussion_r1375738904
##########
seatunnel-translation/seatunnel-translation-base/src/main/java/org/apache/seatunnel/translation/source/CoordinatedSource.java:
##########
@@ -165,7 +165,12 @@ public void run(Collector<T> collector) throws Exception {
while (flag.get()) {
try {
reader.pollNext(collector);
-
Thread.sleep(SLEEP_TIME_INTERVAL);
+ if
(collector.isEmptyThisPollNext()) {
+ Thread.sleep(100);
+ } else {
+
collector.resetEmptyThisPollNext();
+ Thread.sleep(0L);
Review Comment:
why `Thread.sleep(0L)` ?
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-2.4/src/main/java/org/apache/seatunnel/translation/spark/source/reader/batch/CoordinatedBatchPartitionReader.java:
##########
@@ -87,7 +87,12 @@ public void run(Collector<SeaTunnelRow> collector) throws
Exception {
while (flag.get()) {
try {
reader.pollNext(rowCollector);
-
Thread.sleep(SLEEP_TIME_INTERVAL);
+ if
(rowCollector.isEmptyThisPollNext()) {
+ Thread.sleep(100);
+ } else {
+
rowCollector.resetEmptyThisPollNext();
+ Thread.sleep(0L);
Review Comment:
Same as above.
##########
seatunnel-translation/seatunnel-translation-base/src/main/java/org/apache/seatunnel/translation/source/ParallelSource.java:
##########
@@ -134,7 +132,12 @@ public void run(Collector<T> collector) throws Exception {
future.get();
}
reader.pollNext(collector);
- Thread.sleep(SLEEP_TIME_INTERVAL);
+ if (collector.isEmptyThisPollNext()) {
+ Thread.sleep(100);
+ } else {
+ collector.resetEmptyThisPollNext();
+ Thread.sleep(0L);
Review Comment:
Save as above.
--
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]