| 238 | }; |
| 239 | |
| 240 | struct InputStateComparator { |
| 241 | bool operator()(const std::shared_ptr<InputState>& lhs, |
| 242 | const std::shared_ptr<InputState>& rhs) const { |
| 243 | // True if lhs is ahead of time of rhs |
| 244 | if (lhs->Finished()) { |
| 245 | return false; |
| 246 | } |
| 247 | if (rhs->Finished()) { |
| 248 | return false; |
| 249 | } |
| 250 | time_unit_t lFirst = lhs->GetLatestTime(); |
| 251 | time_unit_t rFirst = rhs->GetLatestTime(); |
| 252 | return lFirst > rFirst; |
| 253 | } |
| 254 | }; |
| 255 | |
| 256 | class SortedMergeNode : public ExecNode { |
| 257 | static constexpr int64_t kTargetOutputBatchSize = 1024 * 1024; |