* After each graph run step, check if any ordered query's topK operator * needs more data. If so, load more rows via requestLimitedSnapshot.
()
| 877 | * needs more data. If so, load more rows via requestLimitedSnapshot. |
| 878 | */ |
| 879 | private loadMoreIfNeeded(): void { |
| 880 | for (const [, orderByInfo] of Object.entries( |
| 881 | this.optimizableOrderByCollections, |
| 882 | )) { |
| 883 | if (!orderByInfo.dataNeeded || !orderByInfo.index) continue |
| 884 | |
| 885 | if (this.pendingOrderedLoadPromise) { |
| 886 | // Wait for in-flight loads to complete before requesting more |
| 887 | continue |
| 888 | } |
| 889 | |
| 890 | const n = orderByInfo.dataNeeded() |
| 891 | if (n > 0) { |
| 892 | this.loadNextItems(orderByInfo, n) |
| 893 | } |
| 894 | } |
| 895 | } |
| 896 | |
| 897 | /** |
| 898 | * Load n more items from the source collection, starting from the cursor |
no test coverage detected