| 155 | } |
| 156 | |
| 157 | ThreadFuture<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 | |
| 195 | ThreadFuture<Standalone<VectorRef<const char*>>> DLTransaction::getAddressesForKey(const KeyRef& key) { |
| 196 | FdbCApi::FDBFuture* f = api->transactionGetAddressesForKey(tr, key.begin(), key.size()); |
nothing calls this directly
no test coverage detected