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

Method getMappedRange

fdbclient/MultiVersionTransaction.actor.cpp:157–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157ThreadFuture<MappedRangeResult> DLTransaction::getMappedRange(const KeySelectorRef& begin,
158 const KeySelectorRef& end,
159 const StringRef& mapper,
160 GetRangeLimits limits,
161 int matchIndex,
162 bool snapshot,
163 bool reverse) {
164 FdbCApi::FDBFuture* f = api->transactionGetMappedRange(tr,
165 begin.getKey().begin(),
166 begin.getKey().size(),
167 begin.orEqual,
168 begin.offset,
169 end.getKey().begin(),
170 end.getKey().size(),
171 end.orEqual,
172 end.offset,
173 mapper.begin(),
174 mapper.size(),
175 limits.rows,
176 limits.bytes,
177 FDB_STREAMING_MODE_EXACT,
178 0,
179 matchIndex,
180 snapshot,
181 reverse);
182 return toThreadFuture<MappedRangeResult>(api, f, [](FdbCApi::FDBFuture* f, FdbCApi* api) {
183 const FdbCApi::FDBMappedKeyValue* kvms;
184 int count;
185 FdbCApi::fdb_bool_t more;
186 FdbCApi::fdb_error_t error = api->futureGetMappedKeyValueArray(f, &kvms, &count, &more);
187 ASSERT(!error);
188
189 // The memory for this is stored in the FDBFuture and is released when the future gets destroyed
190 return MappedRangeResult(
191 MappedRangeResultRef(VectorRef<MappedKeyValueRef>((MappedKeyValueRef*)kvms, count), more), Arena());
192 });
193}
194
195ThreadFuture<Standalone<VectorRef<const char*>>> DLTransaction::getAddressesForKey(const KeyRef& key) {
196 FdbCApi::FDBFuture* f = api->transactionGetAddressesForKey(tr, key.begin(), key.size());

Callers

nothing calls this directly

Calls 9

MappedRangeResultClass · 0.85
getTransactionFunction · 0.85
abortableFutureFunction · 0.85
getKeyMethod · 0.65
getMappedRangeMethod · 0.65
ArenaClass · 0.50
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected