You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by Diego Salvi <lo...@gmail.com> on 2022/09/18 13:02:06 UTC
[DISCUSS] BP-57 Add a public API for creating embeddable servers
Hi BookKeepers,
I've added a new BP to add a public API for creating embeddable servers:
BP-57 <https://github.com/apache/bookkeeper/issues/3494>
*Motivation*
BK is used and run in many OS project as an embedded resource.
Every time a project needs to embed BK (think about Pulsar, Pravega or
HerdDB as some examples) boilerplate code need to be written (and then
mantained as per 4.15 changes).
Depending from the contest new feature cannot be made directly available
and more code need to be added.
To run an embedded bookie you need to instantiate many components that are
really in "public" api and can and will be subject to changes.
*Proposal*
We already have the whole code to start a BK server instance, it just needs
to be refactored and exposed as a public API.
My idea is to refactor all the code currently at
org.apache.bookkeeper.server.Main#buildBookieServer and expose it with a
builder pattern.
The builder will accept an initial BookieConfiguration (and with no more
interaction will produce the same server currently produced from
org.apache.bookkeeper.server.Main#buildBookieServer) and will create from
the configuration any component not directly provided to the builder.
For example you can provide your instances for StatsProvider or
MetadataBookieDriver instance or your custom ByteBufAllocator without the
need to rewrite the same plain old code.
Another big improvement: new features that whould need additional code to
be added (just think when integrity checking has been added in BP-46) are
already and directly usable.
What do you think about it?
Diego Salvi
Re: [DISCUSS] BP-57 Add a public API for creating embeddable servers
Posted by Hang Chen <ch...@apache.org>.
+1
Great feature! I support this feature.
Thanks,
Hang
steven lu <lu...@gmail.com> 于2022年9月19日周一 15:47写道:
>
> +1
> this idea seems really useful
>
> Diego Salvi <lo...@gmail.com> 于2022年9月18日周日 21:02写道:
>
> > Hi BookKeepers,
> > I've added a new BP to add a public API for creating embeddable servers:
> > BP-57 <https://github.com/apache/bookkeeper/issues/3494>
> >
> > *Motivation*
> > BK is used and run in many OS project as an embedded resource.
> > Every time a project needs to embed BK (think about Pulsar, Pravega or
> > HerdDB as some examples) boilerplate code need to be written (and then
> > mantained as per 4.15 changes).
> > Depending from the contest new feature cannot be made directly available
> > and more code need to be added.
> > To run an embedded bookie you need to instantiate many components that are
> > really in "public" api and can and will be subject to changes.
> >
> > *Proposal*
> > We already have the whole code to start a BK server instance, it just needs
> > to be refactored and exposed as a public API.
> > My idea is to refactor all the code currently at
> > org.apache.bookkeeper.server.Main#buildBookieServer and expose it with a
> > builder pattern.
> > The builder will accept an initial BookieConfiguration (and with no more
> > interaction will produce the same server currently produced from
> > org.apache.bookkeeper.server.Main#buildBookieServer) and will create from
> > the configuration any component not directly provided to the builder.
> > For example you can provide your instances for StatsProvider or
> > MetadataBookieDriver instance or your custom ByteBufAllocator without the
> > need to rewrite the same plain old code.
> > Another big improvement: new features that whould need additional code to
> > be added (just think when integrity checking has been added in BP-46) are
> > already and directly usable.
> >
> > What do you think about it?
> >
> > Diego Salvi
> >
Re: [DISCUSS] BP-57 Add a public API for creating embeddable servers
Posted by steven lu <lu...@gmail.com>.
+1
this idea seems really useful
Diego Salvi <lo...@gmail.com> 于2022年9月18日周日 21:02写道:
> Hi BookKeepers,
> I've added a new BP to add a public API for creating embeddable servers:
> BP-57 <https://github.com/apache/bookkeeper/issues/3494>
>
> *Motivation*
> BK is used and run in many OS project as an embedded resource.
> Every time a project needs to embed BK (think about Pulsar, Pravega or
> HerdDB as some examples) boilerplate code need to be written (and then
> mantained as per 4.15 changes).
> Depending from the contest new feature cannot be made directly available
> and more code need to be added.
> To run an embedded bookie you need to instantiate many components that are
> really in "public" api and can and will be subject to changes.
>
> *Proposal*
> We already have the whole code to start a BK server instance, it just needs
> to be refactored and exposed as a public API.
> My idea is to refactor all the code currently at
> org.apache.bookkeeper.server.Main#buildBookieServer and expose it with a
> builder pattern.
> The builder will accept an initial BookieConfiguration (and with no more
> interaction will produce the same server currently produced from
> org.apache.bookkeeper.server.Main#buildBookieServer) and will create from
> the configuration any component not directly provided to the builder.
> For example you can provide your instances for StatsProvider or
> MetadataBookieDriver instance or your custom ByteBufAllocator without the
> need to rewrite the same plain old code.
> Another big improvement: new features that whould need additional code to
> be added (just think when integrity checking has been added in BP-46) are
> already and directly usable.
>
> What do you think about it?
>
> Diego Salvi
>
Re: [DISCUSS] BP-57 Add a public API for creating embeddable servers
Posted by Nicolò Boschi <bo...@gmail.com>.
Good idea, +1
Nicolò Boschi
Il giorno lun 19 set 2022 alle ore 07:36 Yong Zhang <
zhangyong1025.zy@gmail.com> ha scritto:
> +1
>
> Sounds great
>
> Yong
>
> On Sun, 18 Sept 2022 at 21:20, Enrico Olivelli <eo...@gmail.com>
> wrote:
>
> > +1
> > Really helpful!
> >
> > Enrico
> >
> > Il Dom 18 Set 2022, 15:02 Diego Salvi <lo...@gmail.com> ha
> > scritto:
> >
> > > Hi BookKeepers,
> > > I've added a new BP to add a public API for creating embeddable
> servers:
> > > BP-57 <https://github.com/apache/bookkeeper/issues/3494>
> > >
> > > *Motivation*
> > > BK is used and run in many OS project as an embedded resource.
> > > Every time a project needs to embed BK (think about Pulsar, Pravega or
> > > HerdDB as some examples) boilerplate code need to be written (and then
> > > mantained as per 4.15 changes).
> > > Depending from the contest new feature cannot be made directly
> available
> > > and more code need to be added.
> > > To run an embedded bookie you need to instantiate many components that
> > are
> > > really in "public" api and can and will be subject to changes.
> > >
> > > *Proposal*
> > > We already have the whole code to start a BK server instance, it just
> > needs
> > > to be refactored and exposed as a public API.
> > > My idea is to refactor all the code currently at
> > > org.apache.bookkeeper.server.Main#buildBookieServer and expose it with
> a
> > > builder pattern.
> > > The builder will accept an initial BookieConfiguration (and with no
> more
> > > interaction will produce the same server currently produced from
> > > org.apache.bookkeeper.server.Main#buildBookieServer) and will create
> from
> > > the configuration any component not directly provided to the builder.
> > > For example you can provide your instances for StatsProvider or
> > > MetadataBookieDriver instance or your custom ByteBufAllocator without
> the
> > > need to rewrite the same plain old code.
> > > Another big improvement: new features that whould need additional code
> to
> > > be added (just think when integrity checking has been added in BP-46)
> are
> > > already and directly usable.
> > >
> > > What do you think about it?
> > >
> > > Diego Salvi
> > >
> >
>
Re: [DISCUSS] BP-57 Add a public API for creating embeddable servers
Posted by Yong Zhang <zh...@gmail.com>.
+1
Sounds great
Yong
On Sun, 18 Sept 2022 at 21:20, Enrico Olivelli <eo...@gmail.com> wrote:
> +1
> Really helpful!
>
> Enrico
>
> Il Dom 18 Set 2022, 15:02 Diego Salvi <lo...@gmail.com> ha
> scritto:
>
> > Hi BookKeepers,
> > I've added a new BP to add a public API for creating embeddable servers:
> > BP-57 <https://github.com/apache/bookkeeper/issues/3494>
> >
> > *Motivation*
> > BK is used and run in many OS project as an embedded resource.
> > Every time a project needs to embed BK (think about Pulsar, Pravega or
> > HerdDB as some examples) boilerplate code need to be written (and then
> > mantained as per 4.15 changes).
> > Depending from the contest new feature cannot be made directly available
> > and more code need to be added.
> > To run an embedded bookie you need to instantiate many components that
> are
> > really in "public" api and can and will be subject to changes.
> >
> > *Proposal*
> > We already have the whole code to start a BK server instance, it just
> needs
> > to be refactored and exposed as a public API.
> > My idea is to refactor all the code currently at
> > org.apache.bookkeeper.server.Main#buildBookieServer and expose it with a
> > builder pattern.
> > The builder will accept an initial BookieConfiguration (and with no more
> > interaction will produce the same server currently produced from
> > org.apache.bookkeeper.server.Main#buildBookieServer) and will create from
> > the configuration any component not directly provided to the builder.
> > For example you can provide your instances for StatsProvider or
> > MetadataBookieDriver instance or your custom ByteBufAllocator without the
> > need to rewrite the same plain old code.
> > Another big improvement: new features that whould need additional code to
> > be added (just think when integrity checking has been added in BP-46) are
> > already and directly usable.
> >
> > What do you think about it?
> >
> > Diego Salvi
> >
>
Re: [DISCUSS] BP-57 Add a public API for creating embeddable servers
Posted by Enrico Olivelli <eo...@gmail.com>.
+1
Really helpful!
Enrico
Il Dom 18 Set 2022, 15:02 Diego Salvi <lo...@gmail.com> ha
scritto:
> Hi BookKeepers,
> I've added a new BP to add a public API for creating embeddable servers:
> BP-57 <https://github.com/apache/bookkeeper/issues/3494>
>
> *Motivation*
> BK is used and run in many OS project as an embedded resource.
> Every time a project needs to embed BK (think about Pulsar, Pravega or
> HerdDB as some examples) boilerplate code need to be written (and then
> mantained as per 4.15 changes).
> Depending from the contest new feature cannot be made directly available
> and more code need to be added.
> To run an embedded bookie you need to instantiate many components that are
> really in "public" api and can and will be subject to changes.
>
> *Proposal*
> We already have the whole code to start a BK server instance, it just needs
> to be refactored and exposed as a public API.
> My idea is to refactor all the code currently at
> org.apache.bookkeeper.server.Main#buildBookieServer and expose it with a
> builder pattern.
> The builder will accept an initial BookieConfiguration (and with no more
> interaction will produce the same server currently produced from
> org.apache.bookkeeper.server.Main#buildBookieServer) and will create from
> the configuration any component not directly provided to the builder.
> For example you can provide your instances for StatsProvider or
> MetadataBookieDriver instance or your custom ByteBufAllocator without the
> need to rewrite the same plain old code.
> Another big improvement: new features that whould need additional code to
> be added (just think when integrity checking has been added in BP-46) are
> already and directly usable.
>
> What do you think about it?
>
> Diego Salvi
>