| 380 | } |
| 381 | |
| 382 | Status SaveHashTable( |
| 383 | BundleWriter* writer, HashTable* table, |
| 384 | const std::vector<TensibleVariable*>& tensibles, |
| 385 | const string& table_name, const std::vector<string>& tensibles_name, |
| 386 | int64 slice_beg, int64 slice_length, int64 slice_size) { |
| 387 | LOG(INFO) << "Save"; |
| 388 | std::vector<std::pair<int64, int64>> snapshot; |
| 389 | CoalescedHashTable* coalesced_table = |
| 390 | dynamic_cast<CoalescedHashTable*>(table); |
| 391 | if (coalesced_table == nullptr) { |
| 392 | snapshot = table->Snapshot(); |
| 393 | } else { |
| 394 | TF_RETURN_IF_ERROR(coalesced_table->ChildSnapshot(table_name, &snapshot)); |
| 395 | } |
| 396 | TF_RETURN_IF_ERROR(SaveHashTableHelper( |
| 397 | writer, snapshot, tensibles, table_name, tensibles_name, |
| 398 | slice_beg, slice_length, slice_size)); |
| 399 | LOG(INFO) << "Save Done"; |
| 400 | return Status::OK(); |
| 401 | } |
| 402 | |
| 403 | namespace { |
| 404 | struct RestoreHashTableSlice { |
no test coverage detected