| 48 | } |
| 49 | |
| 50 | void BlockIO::reset() |
| 51 | { |
| 52 | /** process_list_entry should be destroyed after in, after out and after pipeline, |
| 53 | * since in, out and pipeline contain pointer to objects inside process_list_entry (query-level MemoryTracker for example), |
| 54 | * which could be used before destroying of in and out. |
| 55 | * |
| 56 | * However, QueryStatus inside process_list_entry holds shared pointers to streams for some reason. |
| 57 | * Streams must be destroyed before storage locks, storages and contexts inside pipeline, |
| 58 | * so releaseQueryStreams() is required. |
| 59 | */ |
| 60 | /// TODO simplify it all |
| 61 | |
| 62 | out.reset(); |
| 63 | in.reset(); |
| 64 | if (process_list_entry) |
| 65 | process_list_entry->get().releaseQueryStreams(); |
| 66 | pipeline.reset(); |
| 67 | coordinator.reset(); |
| 68 | plan_segment_process_entry.reset(); |
| 69 | process_list_entry.reset(); |
| 70 | |
| 71 | /// TODO Do we need also reset callbacks? In which order? |
| 72 | } |
| 73 | |
| 74 | BlockIO & BlockIO::operator= (BlockIO && rhs) |
| 75 | { |