Thread (23 messages) 23 messages, 4 authors, 2024-08-20

Re: [PATCH 01/10] reftable/merged: expose functions to initialize iterators

From: Patrick Steinhardt <hidden>
Date: 2024-08-20 12:00:56

On Mon, Aug 19, 2024 at 11:55:16AM -0500, Justin Tobler wrote:
On 24/08/13 08:24AM, Patrick Steinhardt wrote:
quoted
We do not expose any functions via our public headers that would allow a
caller to initialize a reftable iterator from a merged table. Instead,
they are expected to go via the generic `reftable_table` interface,
which is somewhat roundabout.

Implement two new functions to initialize iterators for ref and log
records to plug this gap.

Signed-off-by: Patrick Steinhardt <redacted>
---
[snip]
quoted
diff --git a/reftable/reftable-merged.h b/reftable/reftable-merged.h
index 14d5fc9f05..4deb0ad22e 100644
--- a/reftable/reftable-merged.h
+++ b/reftable/reftable-merged.h
@@ -36,6 +36,14 @@ int reftable_new_merged_table(struct reftable_merged_table **dest,
 			      struct reftable_table *stack, size_t n,
 			      uint32_t hash_id);
 
+/* Initialize a merged table iterator for reading refs. */
+void reftable_merged_table_init_ref_iterator(struct reftable_merged_table *mt,
+					     struct reftable_iterator *it);
+
+/* Initialize a merged table iterator for reading logs. */
+void reftable_merged_table_init_log_iterator(struct reftable_merged_table *mt,
+					     struct reftable_iterator *it);
I might have missed it, but I do not see 
`reftable_merged_table_init_log_iterator()` used anywhere in the later
patches. Does this need to be added? Or are we just adding it because we
want a companion function to the ref iterator to be more consistent? 
The latter. It really should exist to make the public interface
complete.

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help