You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/08/01 14:07:26 UTC
[GitHub] [pinot] walterddr commented on a diff in pull request #11229: [draft][test] no-op removal with yield
walterddr commented on code in PR #11229:
URL: https://github.com/apache/pinot/pull/11229#discussion_r1280702116
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/pipeline/PipelineBreakerOperator.java:
##########
@@ -70,14 +71,52 @@ public String toExplainString() {
@Override
protected TransferableBlock getNextBlock() {
- Pair<Integer, TransferableBlock> pair = _blockConsumer.readBlockBlocking();
- TransferableBlock block = pair.getRight();
- if (block.isDataBlock()) {
- _resultMap.get(pair.getLeft()).add(block);
- return block;
- } else if (block.isErrorBlock()) {
- constructErrorResponse(block);
- return block;
+ while (!_workerEntries.isEmpty()) {
+ if (_errorBlock != null) {
+ return _errorBlock;
+ }
+ if (System.currentTimeMillis() > _context.getDeadlineMs()) {
+ _errorBlock = TransferableBlockUtils.getErrorTransferableBlock(QueryException.EXECUTION_TIMEOUT_ERROR);
+ constructErrorResponse(_errorBlock);
+ return _errorBlock;
+ }
+
+ // Poll from every mailbox operator in round-robin fashion:
+ // - Return the first content block
+ // - If no content block found but there are mailboxes not finished, return no-op block
+ // - If all content blocks are already returned, return end-of-stream block
+ int numWorkers = _workerEntries.size();
+ for (int i = 0; i < numWorkers; i++) {
+ Map.Entry<Integer, Operator<TransferableBlock>> worker = _workerEntries.remove();
+ TransferableBlock block = worker.getValue().nextBlock();
Review Comment:
yes. currently the pipeline breaker behavior is blocking thus i cannot process the main opChain until all mailboxes are received anyway. i think this is fair for now but optimization can be done later
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org