| 156 | } |
| 157 | |
| 158 | static uint64_t getOutputPositions( |
| 159 | const std::shared_ptr<Task>& task, |
| 160 | const std::string& operatorType) { |
| 161 | uint64_t count = 0; |
| 162 | for (const auto& pipelineStat : task->taskStats().pipelineStats) { |
| 163 | for (const auto& operatorStat : pipelineStat.operatorStats) { |
| 164 | if (operatorStat.operatorType == operatorType) { |
| 165 | count += operatorStat.outputPositions; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | return count; |
| 170 | } |
| 171 | |
| 172 | // Returns the max hash build spill level by 'task'. |
| 173 | int32_t maxHashBuildSpillLevel(const exec::Task& task) { |