Clarify result of querying for key intersecting mutation

This commit is contained in:
2024-05-06 10:10:18 -07:00
parent c8088a8209
commit 393168ff53

View File

@@ -121,9 +121,9 @@ struct VersionedMap {
/** 0 if this iterator's param1 is equal to the queried key, < 0 if this
* iterator's param1 is less than the queried key, and > 0 if this
* iterator's param1 is greater than the queried key. Iterating forward is
* treated as a query for the first param1 greater than this iterator's key,
* so will always result in a `cmp` > 0, and the converse for iterating
* backward (`cmp` < 0). */
* treated as a query for the first mutation greater than this iterator's
* mutation, so will always result in a `cmp` > 0, and the converse for
* iterating backward (`cmp` < 0). */
int cmp() const;
/** @private */
@@ -133,12 +133,15 @@ struct VersionedMap {
Impl *impl = nullptr;
};
/** Perform `count` "first greater than or equal to" queries. The result of
* querying `key[i]` at `version[i]` is `iterator[i]`. `version[i]` must be >=
* `getOldestVersion()` and <= `getVersion()`. Thread-safe as long as a
* version is not concurrently invalidated by `setOldestVersion`. There's a
* performance benefit if you pass iterator[i] previously obtained at
* version[i]. */
/** Perform `count` "first greater than or equal to" queries. If there's a
* mutation intersecting `key[i]` at `version[i]` then `iterator[i]` will
* point to that mutation. Otherwise it points to the first mutation greater
* or `end()` if none exists. `version[i]` must be >= `getOldestVersion()`
* and <= `getVersion()`.
*
* Thread-safe as long as a version is not concurrently invalidated by
* `setOldestVersion`. There's a performance benefit if you pass iterator[i]
* previously obtained at version[i]. */
void firstGeq(const Key *key, const int64_t *version, Iterator *iterator,
int count) const;