10
10
#ifndef LLFS_PAGE_VIEW_HPP
11
11
#define LLFS_PAGE_VIEW_HPP
12
12
13
+ #include < llfs/api_types.hpp>
13
14
#include < llfs/key.hpp>
14
15
#include < llfs/optional.hpp>
15
16
#include < llfs/page_buffer.hpp>
@@ -33,7 +34,6 @@ class PageView
33
34
{
34
35
public:
35
36
// ==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
36
- using LowerBoundParam = std::variant<KeyView, usize>;
37
37
38
38
explicit PageView (std::shared_ptr<const PageBuffer>&& data) noexcept
39
39
: data_{std::move (data)}
@@ -94,29 +94,27 @@ class PageView
94
94
*/
95
95
virtual Optional<KeyView> max_key () const = 0;
96
96
97
- /* * \brief Retrieves at most `key_buffer_size ` number of keys contained in this page.
97
+ /* * \brief Retrieves at most the size of `key_buffer_out ` number of keys contained in this page.
98
98
*
99
99
* \param lower_bound This parameter allows for "skipping" to an arbitrary place in the page's key
100
- * set. The caller can provide either a `KeyView` value or an index into the key set, which
101
- * represents the starting key from which this function will collect keys from to return.
100
+ * set. The caller should provide an index (offset) into the key set, which represents the
101
+ * starting key from which this function will collect keys from to return.
102
102
*
103
103
* \param key_buffer_out The output buffer that will be filled by this function with the requested
104
104
* keys.
105
105
*
106
- * \param key_buffer_size The size of the output buffer holding the returned keys.
107
- *
108
106
* \param storage A `StableStringStore` instance that the caller can provide so that the returned
109
107
* keys can still be a list of `KeyView` even if the keys in the page are stored in a way that
110
108
* isn't contiguous or are compressed. Specific implementations of `PageView` will choose to use
111
109
* this based on their key storage.
112
110
*
113
- * \return The number of keys filled into `key_buffer_out`. This value will either be
114
- * `key_buffer_size ` or the number of keys between `lower_bound` and the end of the key set,
115
- * whichever is smaller. In the event that the `lower_bound` parameter provided does not exist in
116
- * the key set (or is out of the range of the key set) , this function will return 0.
111
+ * \return The number of keys filled into `key_buffer_out`. This value will either be the size of
112
+ * `key_buffer_out ` or the number of keys between `lower_bound` and the end of the key set,
113
+ * whichever is smaller. In the event that the `lower_bound` parameter provided is out of the
114
+ * range of the key set, this function will return 0.
117
115
*/
118
- virtual StatusOr<usize> get_keys (LowerBoundParam lower_bound, KeyView* key_buffer_out,
119
- usize key_buffer_size, StableStringStore& storage) const ;
116
+ virtual StatusOr<usize> get_keys (ItemOffset lower_bound, const Slice< KeyView>& key_buffer_out,
117
+ StableStringStore& storage) const ;
120
118
121
119
// Builds a key-based approximate member query (AMQ) filter for the page, to answer the question
122
120
// whether a given key *might* be contained by the page.
0 commit comments