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