| 397 | } |
| 398 | |
| 399 | void TupleCacheNode::Close(RuntimeState* state) { |
| 400 | if (is_closed()) return; |
| 401 | // If we reach this point with an open writer_, then this cache entry is invalid. We |
| 402 | // will delete the file and abort the write. This can happen if the query is cancelled, |
| 403 | // if the query hits an error, or if a parent node has a limit and doesn't complete |
| 404 | // fetching. This is intentionally restrictive. |
| 405 | if (writer_) { |
| 406 | TupleCacheMgr* tuple_cache_mgr = ExecEnv::GetInstance()->tuple_cache_mgr(); |
| 407 | writer_->Abort(); |
| 408 | tuple_cache_mgr->AbortWrite(move(handle_), false); |
| 409 | } |
| 410 | if (debug_dump_text_writer_) { |
| 411 | debug_dump_text_writer_->Delete(); |
| 412 | debug_dump_text_writer_.reset(); |
| 413 | } |
| 414 | if (debug_dump_text_writer_ref_) { |
| 415 | debug_dump_text_writer_ref_->Delete(); |
| 416 | debug_dump_text_writer_ref_.reset(); |
| 417 | } |
| 418 | ReleaseResult(); |
| 419 | ExecNode::Close(state); |
| 420 | } |
| 421 | |
| 422 | string TupleCacheNode::GetDebugDumpPath(const RuntimeState* state, |
| 423 | const string& org_fragment_id, string* sub_dir_full_path) const { |
no test coverage detected