-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add consuming metadata to broker response #9092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| import org.apache.pinot.core.common.Operator; | ||
| import org.apache.pinot.core.operator.ExecutionStatistics; | ||
| import org.apache.pinot.core.operator.blocks.IntermediateResultsBlock; | ||
| import org.apache.pinot.segment.spi.MutableSegment; | ||
|
|
||
|
|
||
| @SuppressWarnings("rawtypes") | ||
|
|
@@ -56,6 +57,8 @@ public static void setExecutionStatistics(IntermediateResultsBlock resultsBlock, | |
| long threadCpuTimeNs, int numServerThreads) { | ||
| int numSegmentsProcessed = operators.size(); | ||
| int numSegmentsMatched = 0; | ||
| int numConsumingSegmentsProcessed = 0; | ||
| int numConsumingSegmentsMatched = 0; | ||
| long numDocsScanned = 0; | ||
| long numEntriesScannedInFilter = 0; | ||
| long numEntriesScannedPostFilter = 0; | ||
|
|
@@ -65,13 +68,24 @@ public static void setExecutionStatistics(IntermediateResultsBlock resultsBlock, | |
| if (executionStatistics.getNumDocsScanned() > 0) { | ||
| numSegmentsMatched++; | ||
| } | ||
| try { | ||
|
||
| if (operator.getIndexSegment() instanceof MutableSegment) { | ||
| numConsumingSegmentsProcessed += 1; | ||
| if (executionStatistics.getNumDocsScanned() > 0) { | ||
| numConsumingSegmentsMatched++; | ||
| } | ||
| } | ||
| } catch (UnsupportedOperationException ignored) { } | ||
|
|
||
| numDocsScanned += executionStatistics.getNumDocsScanned(); | ||
| numEntriesScannedInFilter += executionStatistics.getNumEntriesScannedInFilter(); | ||
| numEntriesScannedPostFilter += executionStatistics.getNumEntriesScannedPostFilter(); | ||
| numTotalDocs += executionStatistics.getNumTotalDocs(); | ||
| } | ||
| resultsBlock.setNumSegmentsProcessed(numSegmentsProcessed); | ||
| resultsBlock.setNumSegmentsMatched(numSegmentsMatched); | ||
| resultsBlock.setNumConsumingSegmentsProcessed(numConsumingSegmentsProcessed); | ||
| resultsBlock.setNumConsumingSegmentsMatched(numConsumingSegmentsMatched); | ||
| resultsBlock.setNumDocsScanned(numDocsScanned); | ||
| resultsBlock.setNumEntriesScannedInFilter(numEntriesScannedInFilter); | ||
| resultsBlock.setNumEntriesScannedPostFilter(numEntriesScannedPostFilter); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(MAJOR) Please revert this PR, and re-check it in after it passes the compatibility test. We cannot add
MetadataKeyin the middle because we use ordinal to encode the key. See the comment of this enumThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. This is a breaking change