diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-05-30 14:15:12 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-30 14:15:12 -0700 |
| commit | 67ce50ba26507e99c53dcd4b1d85ad8565a31c23 (patch) | |
| tree | e763be0471f64532de926a43eca14532d84a9d5d /reftable/reftable-stack.h | |
| parent | 23528d352ac4b4fdfd982e7f9a12f306518ca8b6 (diff) | |
| parent | 369b84196e5b12496a18d4ea683b507bd0f1d953 (diff) | |
| download | git-67ce50ba26507e99c53dcd4b1d85ad8565a31c23.tar.xz | |
Merge branch 'ps/reftable-reusable-iterator'
Code clean-up to make the reftable iterator closer to be reusable.
* ps/reftable-reusable-iterator:
reftable/merged: adapt interface to allow reuse of iterators
reftable/stack: provide convenience functions to create iterators
reftable/reader: adapt interface to allow reuse of iterators
reftable/generic: adapt interface to allow reuse of iterators
reftable/generic: move seeking of records into the iterator
reftable/merged: simplify indices for subiterators
reftable/merged: split up initialization and seeking of records
reftable/reader: set up the reader when initializing table iterator
reftable/reader: inline `reader_seek_internal()`
reftable/reader: separate concerns of table iter and reftable reader
reftable/reader: unify indexed and linear seeking
reftable/reader: avoid copying index iterator
reftable/block: use `size_t` to track restart point index
Diffstat (limited to 'reftable/reftable-stack.h')
| -rw-r--r-- | reftable/reftable-stack.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h index c15632c401..09e97c9991 100644 --- a/reftable/reftable-stack.h +++ b/reftable/reftable-stack.h @@ -66,6 +66,24 @@ int reftable_stack_add(struct reftable_stack *st, void *write_arg), void *write_arg); +struct reftable_iterator; + +/* + * Initialize an iterator for the merged tables contained in the stack that can + * be used to iterate through refs. The iterator is valid until the next reload + * or write. + */ +void reftable_stack_init_ref_iterator(struct reftable_stack *st, + struct reftable_iterator *it); + +/* + * Initialize an iterator for the merged tables contained in the stack that can + * be used to iterate through logs. The iterator is valid until the next reload + * or write. + */ +void reftable_stack_init_log_iterator(struct reftable_stack *st, + struct reftable_iterator *it); + /* returns the merged_table for seeking. This table is valid until the * next write or reload, and should not be closed or deleted. */ |
