gaoran10 commented on a change in pull request #9628:
URL: https://github.com/apache/pulsar/pull/9628#discussion_r586937758
##########
File path:
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java
##########
@@ -347,8 +355,16 @@ public void run() {
entriesProcessed += entriesToSkip;
} else {
- outstandingReadsRequests.decrementAndGet();
- cursor.asyncReadEntries(batchSize, this,
System.nanoTime(), PositionImpl.latest);
+ long maxSizeBytes =
entryCacheSizeAllocator.getAvailableCacheSize();
+ // if the available size is invalid and the entry
queue size is 0, read one entry
+ if (maxSizeBytes > 0 || entryQueue.size() == 0) {
+ outstandingReadsRequests.decrementAndGet();
+ cursor.asyncReadEntries(batchSize,
maxSizeBytes,
+ this, System.nanoTime(),
PositionImpl.latest);
+ } else {
+ metricsTracker.incr_READ_ATTEMPTS_FAIL();
Review comment:
Oh yes, I'll fix this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]