From: Patrick Steinhardt <ps@pks.im>
To: karthik nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 01/10] reftable/merged: expose functions to initialize iterators
Date: Wed, 14 Aug 2024 14:56:48 +0200 [thread overview]
Message-ID: <ZryphS1KICCYWi9z@tanuki> (raw)
In-Reply-To: <CAOLa=ZSY8EWuXAK_tF4sSYGHs2Mv6nE-YtVtVkau4k5h=hOEdA@mail.gmail.com>
On Tue, Aug 13, 2024 at 05:36:27AM -0400, karthik nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > 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 <ps@pks.im>
> > ---
> > reftable/merged.c | 12 ++++++++++++
> > reftable/reftable-merged.h | 8 ++++++++
> > 2 files changed, 20 insertions(+)
> >
> > diff --git a/reftable/merged.c b/reftable/merged.c
> > index 6adce44f4b..8d78b3da71 100644
> > --- a/reftable/merged.c
> > +++ b/reftable/merged.c
> > @@ -254,6 +254,18 @@ void merged_table_init_iter(struct reftable_merged_table *mt,
> > iterator_from_merged_iter(it, mi);
> > }
> >
> > +void reftable_merged_table_init_ref_iterator(struct reftable_merged_table *mt,
> > + struct reftable_iterator *it)
> > +{
> > + merged_table_init_iter(mt, it, BLOCK_TYPE_REF);
> > +}
> > +
> > +void reftable_merged_table_init_log_iterator(struct reftable_merged_table *mt,
> > + struct reftable_iterator *it)
> > +{
> > + merged_table_init_iter(mt, it, BLOCK_TYPE_LOG);
> > +}
> > +
>
> These too look similar to `static void
> reftable_merged_table_init_iter_void` defined a little below, I wonder
> if we could have simply exposed that? Perhaps we remove it in the
> upcoming patches.
Yup, `reftable_merged_table_init_iter_void()` is about to go away. But
regardless of that, even if it didn't it would make sense to have both
functions. The `iter_void()` one takes an arbitrary block type as input,
which we never expose via our public interfaces. So it has to stay an
implementation detail. The new ones added here do not expose the block
type.
Patrick
next prev parent reply other threads:[~2024-08-14 12:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 6:24 [PATCH 00/10] reftable: drop generic `reftable_table` interface Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 01/10] reftable/merged: expose functions to initialize iterators Patrick Steinhardt
2024-08-13 9:36 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt [this message]
2024-08-19 16:55 ` Justin Tobler
2024-08-20 12:00 ` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 02/10] reftable/merged: rename `reftable_new_merged_table()` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 03/10] reftable/merged: stop using generic tables in the merged table Patrick Steinhardt
2024-08-13 9:58 ` karthik nayak
2024-08-19 16:47 ` Justin Tobler
2024-08-13 6:24 ` [PATCH 04/10] reftable/stack: open-code reading refs Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 05/10] reftable/iter: drop double-checking logic Patrick Steinhardt
2024-08-13 6:57 ` Eric Sunshine
2024-08-13 6:24 ` [PATCH 06/10] reftable/generic: move generic iterator code into iterator interface Patrick Steinhardt
2024-08-13 10:04 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt
2024-08-14 16:24 ` Junio C Hamano
2024-08-15 11:04 ` karthik nayak
2024-08-13 6:24 ` [PATCH 07/10] reftable/dump: drop unused `compact_stack()` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 08/10] reftable/dump: drop unused printing functionality Patrick Steinhardt
2024-08-13 10:14 ` karthik nayak
2024-08-14 12:56 ` Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 09/10] reftable/dump: move code into "t/helper/test-reftable.c" Patrick Steinhardt
2024-08-13 6:24 ` [PATCH 10/10] reftable/generic: drop interface Patrick Steinhardt
2024-08-13 10:17 ` [PATCH 00/10] reftable: drop generic `reftable_table` interface karthik nayak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZryphS1KICCYWi9z@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).