Re: [PATCH 14/16] reftable/table: introduce iterator for table blocks
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 7, 2025, 12:31 UTC
- Message-ID
- <Z_PFkoNgCXrqZUwl@pks.im>
- In-Reply-To
- <q6shqgjoe5vlt3fduj6cq6473plz7mmlmnmyuwft7huuod5hhn@je7sijo3v54z>
On Wed, Apr 02, 2025 at 04:46:06PM -0500, Justin Tobler wrote:
Show 29 quoted lines
> On 25/03/31 10:41AM, Patrick Steinhardt wrote:
> > diff --git a/reftable/reftable-table.h b/reftable/reftable-table.h
> > index a78db9eea7e..f0f1784c664 100644
> > --- a/reftable/reftable-table.h
> > +++ b/reftable/reftable-table.h
> > @@ -10,6 +10,7 @@
> > #define REFTABLE_TABLE_H
> >
> > #include "reftable-iterator.h"
> > +#include "reftable-block.h"
> > #include "reftable-blocksource.h"
> >
> > /*
> > @@ -99,4 +100,19 @@ uint64_t reftable_table_min_update_index(struct reftable_table *t);
> > /* print blocks onto stdout for debugging. */
> > int reftable_table_print_blocks(const char *tablename);
> >
> > +/*
> > + * An iterator that iterates through the blocks contained in a given table.
> > + */
> > +struct reftable_table_iterator {
> > + void *iter_arg;
> > +};
> > +
> > +int reftable_table_init_table_iterator(struct reftable_table *t,
> > + struct reftable_table_iterator *it);
>
> Any reason we don't call this `reftable_table_iterator_init`? Seems like
> it would more closely match the other functions.No, good point. We should change the parameter order in that case, as well.
Patrick