| 510 | } |
| 511 | |
| 512 | void DmlExecState::AddPartition( |
| 513 | const string& name, int64_t id, const string* base_dir, |
| 514 | const string* staging_dir_to_clean_up) { |
| 515 | lock_guard<mutex> l(lock_); |
| 516 | DCHECK(per_partition_status_.find(name) == per_partition_status_.end()) |
| 517 | << "Partition status of " << name << " already exists"; |
| 518 | DmlPartitionStatusPB status; |
| 519 | status.set_num_modified_rows(0L); |
| 520 | status.set_id(id); |
| 521 | status.mutable_stats()->set_bytes_written(0L); |
| 522 | status.set_partition_base_dir(base_dir != nullptr ? *base_dir : ""); |
| 523 | if (staging_dir_to_clean_up != nullptr) { |
| 524 | DCHECK(!staging_dir_to_clean_up->empty()); |
| 525 | status.set_staging_dir_to_clean_up(*staging_dir_to_clean_up); |
| 526 | } |
| 527 | per_partition_status_.insert(make_pair(name, status)); |
| 528 | } |
| 529 | |
| 530 | void DmlExecState::UpdatePartition(const string& partition_name, |
| 531 | int64_t num_rows_delta, const DmlStatsPB* insert_stats, bool is_delete) { |
no test coverage detected