pub struct Lookup<‘a, ‘k, R = GenericRecord> /* private fields */ The records one lookup matches, read from the server a page at a time in a single pass; made by RecordRetriever::lookup.
On a replicated table every page is taken from one worker rank, drawn at random with the first page: each rank holds the whole table in an order of its own, so a page from another rank could repeat or skip records. If the cluster or the shard mapping changes during the pass (the rank leaving the cluster, a fail-over, a new shard mapping), the lookup fails rather than go on from another rank. A lookup routed by key, or through the head node, reads each page as RecordRetriever::get_by_key_with_offset does, recovering as it does.
size is the number of records the lookup matches, known once its first page has been read; asking for it reads that page.
Implementations
impl<R: RetrievedRecord> Lookup<’_, ’_, R>
pub async fn size(&mut self) -> Result<i64, KineticaError>
How many records the lookup matches in all; reads the first page if none has been read.
Fails if the page cannot be read.
pub async fn next(&mut self) -> Result<Option<R>, KineticaError>
The next record, reading the next page once the last is used up, or None after the last record.
Fails if a page cannot be read, or if the lookup is on a replicated table and the cluster or shard mapping changed during it.