| 664 | } |
| 665 | |
| 666 | string HashTable::DebugString(bool skip_empty, bool show_match, |
| 667 | const RowDescriptor* desc) { |
| 668 | stringstream ss; |
| 669 | ss << endl; |
| 670 | for (int i = 0; i < num_buckets_; ++i) { |
| 671 | if (skip_empty && !buckets_[i].IsFilled()) continue; |
| 672 | ss << i << ": "; |
| 673 | if (show_match) { |
| 674 | if (buckets_[i].IsMatched()) { |
| 675 | ss << " [M]"; |
| 676 | } else { |
| 677 | ss << " [U]"; |
| 678 | } |
| 679 | } |
| 680 | if (buckets_[i].HasDuplicates()) { |
| 681 | DuplicateNode* node = buckets_[i].GetDuplicate(); |
| 682 | bool first = true; |
| 683 | ss << " [D] "; |
| 684 | while (node != NULL) { |
| 685 | if (!first) ss << ","; |
| 686 | DebugStringTuple(ss, node->htdata, desc); |
| 687 | node = node->Next(); |
| 688 | first = false; |
| 689 | } |
| 690 | } else { |
| 691 | ss << " [B] "; |
| 692 | if (buckets_[i].IsFilled()) { |
| 693 | HtData htdata = buckets_[i].GetBucketData().htdata; |
| 694 | DebugStringTuple(ss, htdata, desc); |
| 695 | } else { |
| 696 | ss << " - "; |
| 697 | } |
| 698 | } |
| 699 | ss << endl; |
| 700 | } |
| 701 | return ss.str(); |
| 702 | } |
| 703 | |
| 704 | string HashTable::PrintStats() const { |
| 705 | double curr_fill_factor = |
nothing calls this directly
no test coverage detected