| 160 | |
| 161 | |
| 162 | void IBlockInputStream::readSuffix() |
| 163 | { |
| 164 | #ifndef NDEBUG |
| 165 | if (!read_suffix_is_called) |
| 166 | read_suffix_is_called = true; |
| 167 | else |
| 168 | throw Exception("readSuffix is called twice for " + getName() + " stream", ErrorCodes::LOGICAL_ERROR); |
| 169 | #endif |
| 170 | |
| 171 | /// start of read |
| 172 | UInt64 start_ns = info.total_stopwatch.elapsed(); |
| 173 | UInt64 start_cpu_ns = info.cpu_thread_stopwatch.elapsed(); |
| 174 | |
| 175 | forEachChild([&] (IBlockInputStream & child) |
| 176 | { |
| 177 | child.readSuffix(); |
| 178 | return false; |
| 179 | }); |
| 180 | |
| 181 | readSuffixImpl(); |
| 182 | |
| 183 | /// end of read, update wall time and cpu thread time of current stream |
| 184 | info.wall_time_ns += info.total_stopwatch.elapsed() - start_ns; |
| 185 | info.cpu_time_ns += info.cpu_thread_stopwatch.elapsed() - start_cpu_ns; |
| 186 | } |
| 187 | |
| 188 | |
| 189 | void IBlockInputStream::updateExtremes(Block & block) |