C++ · Scans

Scans

#include <ustore/blobs_range.hpp> 1.0.0-rc.1 · d6d40961

API

Types

blobs_page_tWhat one pull of a cursor hands over inside the arena it was given: the keys, and the values of the keys.
blobs_range.hpp:25 ↗
struct blobs_page_t

Fields

keysstd::span<ustore_key_t const>
valuessz::strings_view_t
match_tWhat a scan or a cursor narrows its keys by, each part zeroed to keep every key: patterns over the values of blobs and strings, a JSONPath or XPath filter over documents and pages, and a predicate over the keys.
blobs_range.hpp:33 ↗
struct match_t

Fields

size_range_tLower and upper bounds of an estimate.
blobs_range.hpp:436 ↗
struct size_range_t

Fields

minstd::size_t
maxstd::size_t
size_estimates_tEstimates of how many entries a key range holds and how much space they take.
blobs_range.hpp:442 ↗
struct size_estimates_t

Fields

cardinalitysize_range_t
bytes_in_valuessize_range_t
bytes_on_disksize_range_t
keys_range_tThe keys of a collection slice, counted by streaming or sampled at random.
blobs_range.hpp:533 ↗
struct keys_range_t

Fields

pairs_range_tThe key-value pairs of a collection slice, counted by streaming.
blobs_range.hpp:576 ↗
struct pairs_range_t

Fields

Classkeys_cursorOwns a walk over the keys of one collection from its open until its destruction, which every pull resumes past the last key the pull before it handed out, at the view its receiver read at the open.6
blobs_range.hpp:72 ↗
template <typename handle_type_,
          typename init_type_,
          typename next_type_,
          void(*)(init_type_ *) init_,
          void(*)(next_type_ *) next_,
          void(*)(handle_type_) free_>
class keys_cursor

The explicit form of the streams below: every pull takes the caller's arena, which holds the page until its next call, so a binding hands the cursor any arena it keeps. It moves but never copies. One template serves the cursors of blobs, documents, pages and graph vertices, each spelled by its C handle and calls.

keys_cursor
blobs_range.hpp:101 ↗
keys_cursor() noexcept=default;
keys_cursor(keys_cursor const &)=delete;
keys_cursor(keys_cursor && other) noexcept;
operator=
blobs_range.hpp:103 ↗
keys_cursor & operator=(keys_cursor const &)=delete;
keys_cursor & operator=(keys_cursor && other) noexcept;
~keys_cursor
blobs_range.hpp:104 ↗
~keys_cursor() noexcept;
nextPulls up to wanted keys into arena, fewer once the walk nears its end and none past it.
blobs_range.hpp:136 ↗
expected<std::span<ustore_key_t const>> next(
    std::size_t wanted,
    arena_t & arena) noexcept;
next_pairsPulls up to wanted keys with their values into arena in one call, the other fields of options, such as the encoding pages render in, taken as they are.
blobs_range.hpp:142 ↗
requires requires(next_type_ next) { next.values; }
expected<blobs_page_t> next_pairs(
    std::size_t wanted,
    arena_t & arena,
    next_type_ options = {}) noexcept;
makeOpens a walk over the keys of collection from start, at the view receiver reads, keeping the keys match admits, compiled once here.
blobs_range.hpp:117 ↗
expected<keys_cursor> make(
    receiver_t receiver,
    ustore_collection_id_t collection,
    ustore_key_t start = smallest_key_k,
    match_t const & match = {}) noexcept;
Classkeys_stream_tA stream over the keys of one collection that pulls them in pages through the scan of its modality, each page resuming past the last key of the one before it.8
blobs_range.hpp:226 ↗
class keys_stream_t

It keeps the arena holding the page in hand, so it moves but never copies, and prefers seek to being rebuilt. As shorthand for a range-based loop, which has no place for an arena, it owns that one arena for its lifetime. A page short of the read-ahead ends the stream, and a default-constructed stream is at the end.

keys_stream_t
blobs_range.hpp:271 ↗
keys_stream_t() noexcept=default;
keys_stream_t(keys_stream_t &&) noexcept=default;
keys_stream_t(keys_stream_t const &)=delete;
operator=
blobs_range.hpp:273 ↗
keys_stream_t & operator=(keys_stream_t &&) noexcept=default;
keys_stream_t & operator=(keys_stream_t const &)=delete;
seekRestarts the stream at key.
blobs_range.hpp:291 ↗
status_t seek(ustore_key_t key) noexcept;
*× 2Advances like advance, but a failed pull ends the stream since a reference carries no status.
blobs_range.hpp:301 ↗
keys_stream_t & operator++() noexcept;
seek_to_next_*_to_next_batch× 2Pulls the page after the one in hand, which keys_batch exposes.
blobs_range.hpp:313 ↗
status_t seek_to_next__to_next_batch() noexcept;
keys_batchExposes the whole page in hand, passed keys included, for use with seek_to_next_batch.
blobs_range.hpp:316 ↗
std::span<ustore_key_t const> keys_batch() noexcept;
*× 2
blobs_range.hpp:325 ↗
bool operator==(keys_stream_t const & other) const noexcept;
Symbolother
operator==keys_stream_t &
operator==pairs_stream_t &
makeOpens a stream over the keys of collection, which holds modality, from start, pulling read_ahead of them a page into an arena of its own, made where the executor of receiver computes.
blobs_range.hpp:280 ↗
expected<keys_stream_t> make(
    receiver_t receiver,
    ustore_collection_id_t collection,
    ustore_key_t start,
    std::size_t read_ahead = default_read_ahead_k,
    ustore_modality_t modality = ustore_modality_blobs_k) noexcept;
Classpairs_stream_tA stream over the keys and values of one collection that pulls both in pages from a cursor, in one call per page.5
blobs_range.hpp:336 ↗
class pairs_stream_t

As shorthand for a range-based loop, which has no place for an arena, it owns that one arena for its lifetime, where blobs_cursor_t takes the caller's per pull. A default-constructed stream is at the end.

pairs_stream_t
blobs_range.hpp:368 ↗
pairs_stream_t() noexcept=default;
pairs_stream_t(pairs_stream_t &&) noexcept=default;
pairs_stream_t(pairs_stream_t const &)=delete;
operator=
blobs_range.hpp:370 ↗
pairs_stream_t & operator=(pairs_stream_t &&) noexcept=default;
pairs_stream_t & operator=(pairs_stream_t const &)=delete;
seekRestarts the stream at key, through a cursor opened there.
blobs_range.hpp:386 ↗
status_t seek(ustore_key_t key) noexcept;
keys_batchExposes the keys of the whole page in hand, passed keys included, for use with seek_to_next_batch.
blobs_range.hpp:419 ↗
std::span<ustore_key_t const> keys_batch() noexcept;
makeOpens a stream over the pairs of collection from start, pulling read_ahead of them a page into an arena of its own, made where the executor of receiver computes.
blobs_range.hpp:376 ↗
expected<pairs_stream_t> make(
    receiver_t receiver,
    ustore_collection_id_t collection,
    ustore_key_t start,
    std::size_t read_ahead = default_read_ahead_k) noexcept;

Functions

predicate_ofThe predicate the ABI asks through callable, called as callable(keys, admissions) over spans once per page, at cost; callable must outlive the scan or the cursor given it.
blobs_range.hpp:43 ↗
template <typename callable_type_>
ustore_predicate_t predicate_of(
    callable_type_ & callable,
    ustore_predicate_cost_t cost = ustore_predicate_cheap_k) noexcept;
narrowCopies what match narrows by into the arguments call takes, as far as they take each part.
blobs_range.hpp:56 ↗
template <typename call_type_>
void narrow(call_type_ & call, match_t const & match) noexcept;
scan_keys_throughScans up to wanted keys of collection from start into arena through scan_, the scan of one modality keyed by UUIDs, at the view receiver reads, keeping the keys match admits, and writing one BM25 score per key into scores when it is not null and the patterns carry weights.
blobs_range.hpp:174 ↗
template <typename scan_type_, void(*)(scan_type_ *) scan_>
expected<std::span<ustore_key_t const>> scan_keys_through(
    receiver_t receiver,
    ustore_collection_id_t collection,
    ustore_key_t start,
    std::size_t wanted,
    arena_t & arena,
    match_t const & match = {},
    float const **scores = nullptr) noexcept;
scan_keysScans up to wanted keys of collection, which holds modality, from start into arena through the scan of that modality: the documents, the vertices, the pages or the keys of blobs.
blobs_range.hpp:204 ↗
expected<std::span<ustore_key_t const>> scan_keys(
    receiver_t receiver,
    ustore_modality_t modality,
    ustore_collection_id_t collection,
    ustore_key_t start,
    std::size_t wanted,
    arena_t & arena) noexcept;
TypesMember types6
keys_stream_t::iterator_categorystd::forward_iterator_tag
keys_stream_t::difference_typestd::ptrdiff_t
keys_stream_t::value_typeustore_key_t
pairs_stream_t::iterator_categorystd::forward_iterator_tag
pairs_stream_t::difference_typestd::ptrdiff_t
pairs_stream_t::value_typestd::pair<ustore_key_t, value_view_t>