| 748 | DDQueue() = default; |
| 749 | |
| 750 | void validate() { |
| 751 | if (EXPENSIVE_VALIDATION) { |
| 752 | for (auto it = fetchingSourcesQueue.begin(); it != fetchingSourcesQueue.end(); ++it) { |
| 753 | // relocates in the fetching queue do not have src servers yet. |
| 754 | if (it->src.size()) |
| 755 | TraceEvent(SevError, "DDQueueValidateError1") |
| 756 | .detail("Problem", "relocates in the fetching queue do not have src servers yet"); |
| 757 | |
| 758 | // relocates in the fetching queue do not have a work factor yet. |
| 759 | if (it->workFactor != 0.0) |
| 760 | TraceEvent(SevError, "DDQueueValidateError2") |
| 761 | .detail("Problem", "relocates in the fetching queue do not have a work factor yet"); |
| 762 | |
| 763 | // relocates in the fetching queue are in the queueMap. |
| 764 | auto range = queueMap.rangeContaining(it->keys.begin); |
| 765 | if (range.value() != *it || range.range() != it->keys) |
| 766 | TraceEvent(SevError, "DDQueueValidateError3") |
| 767 | .detail("Problem", "relocates in the fetching queue are in the queueMap"); |
| 768 | } |
| 769 | |
| 770 | /* |
| 771 | for( auto it = queue.begin(); it != queue.end(); ++it ) { |
| 772 | for( auto rdit = it->second.begin(); rdit != it->second.end(); ++rdit ) { |
| 773 | // relocates in the queue are in the queueMap exactly. |
| 774 | auto range = queueMap.rangeContaining( rdit->keys.begin ); |
| 775 | if( range.value() != *rdit || range.range() != rdit->keys ) |
| 776 | TraceEvent(SevError, "DDQueueValidateError4").detail("Problem", "relocates in the queue are in the queueMap exactly") |
| 777 | .detail("RangeBegin", range.range().begin) |
| 778 | .detail("RangeEnd", range.range().end) |
| 779 | .detail("RelocateBegin2", range.value().keys.begin) |
| 780 | .detail("RelocateEnd2", range.value().keys.end) |
| 781 | .detail("RelocateStart", range.value().startTime) |
| 782 | .detail("MapStart", rdit->startTime) |
| 783 | .detail("RelocateWork", range.value().workFactor) |
| 784 | .detail("MapWork", rdit->workFactor) |
| 785 | .detail("RelocateSrc", range.value().src.size()) |
| 786 | .detail("MapSrc", rdit->src.size()) |
| 787 | .detail("RelocatePrio", range.value().priority) |
| 788 | .detail("MapPrio", rdit->priority); |
| 789 | |
| 790 | // relocates in the queue have src servers |
| 791 | if( !rdit->src.size() ) |
| 792 | TraceEvent(SevError, "DDQueueValidateError5").detail("Problem", "relocates in the queue have src servers"); |
| 793 | |
| 794 | // relocates in the queue do not have a work factor yet. |
| 795 | if( rdit->workFactor != 0.0 ) |
| 796 | TraceEvent(SevError, "DDQueueValidateError6").detail("Problem", "relocates in the queue do not have a work factor yet"); |
| 797 | |
| 798 | bool contains = false; |
| 799 | for( int i = 0; i < rdit->src.size(); i++ ) { |
| 800 | if( rdit->src[i] == it->first ) { |
| 801 | contains = true; |
| 802 | break; |
| 803 | } |
| 804 | } |
| 805 | if( !contains ) |
| 806 | TraceEvent(SevError, "DDQueueValidateError7").detail("Problem", "queued relocate data does not include ss under which its filed"); |
| 807 | } |
no test coverage detected