MCPcopy Create free account
hub / github.com/apple/foundationdb / handleClientBlobRange

Function handleClientBlobRange

fdbserver/BlobManager.actor.cpp:58–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56#define BM_PURGE_DEBUG false
57
58void handleClientBlobRange(KeyRangeMap<bool>* knownBlobRanges,
59 Arena& ar,
60 VectorRef<KeyRangeRef>* rangesToAdd,
61 VectorRef<KeyRangeRef>* rangesToRemove,
62 KeyRef rangeStart,
63 KeyRef rangeEnd,
64 bool rangeActive) {
65 if (BM_DEBUG) {
66 fmt::print(
67 "db range [{0} - {1}): {2}\n", rangeStart.printable(), rangeEnd.printable(), rangeActive ? "T" : "F");
68 }
69 KeyRange keyRange(KeyRangeRef(rangeStart, rangeEnd));
70 auto allRanges = knownBlobRanges->intersectingRanges(keyRange);
71 for (auto& r : allRanges) {
72 if (r.value() != rangeActive) {
73 KeyRef overlapStart = (r.begin() > keyRange.begin) ? r.begin() : keyRange.begin;
74 KeyRef overlapEnd = (keyRange.end < r.end()) ? keyRange.end : r.end();
75 KeyRangeRef overlap(overlapStart, overlapEnd);
76 if (rangeActive) {
77 if (BM_DEBUG) {
78 fmt::print("BM Adding client range [{0} - {1})\n",
79 overlapStart.printable().c_str(),
80 overlapEnd.printable().c_str());
81 }
82 rangesToAdd->push_back_deep(ar, overlap);
83 } else {
84 if (BM_DEBUG) {
85 fmt::print("BM Removing client range [{0} - {1})\n",
86 overlapStart.printable().c_str(),
87 overlapEnd.printable().c_str());
88 }
89 rangesToRemove->push_back_deep(ar, overlap);
90 }
91 }
92 }
93 knownBlobRanges->insert(keyRange, rangeActive);
94}
95
96void updateClientBlobRanges(KeyRangeMap<bool>* knownBlobRanges,
97 RangeResult dbBlobRanges,

Callers 1

updateClientBlobRangesFunction · 0.85

Calls 10

intersectingRangesMethod · 0.80
printFunction · 0.50
KeyRangeRefClass · 0.50
printableMethod · 0.45
valueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
push_back_deepMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected