BinaryObjectBuilder: policy of reusing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

BinaryObjectBuilder: policy of reusing

Sergey Chugunov
Hello folks,

Recently I filed a ticket [1] with very simple test where correct usage of
BinaryObjectBuilder is vague.

The issue boils down to the fact that it is unclear from documentation and
behavior whether reusing of BinaryObjectBuilder is allowed.

Let's discuss here what is the correct behavior and how to fix the issue.

For sure documentation on BinaryObjectBuilder must be updated as well.

[1] https://issues.apache.org/jira/browse/IGNITE-5839
Reply | Threaded
Open this post in threaded view
|

Re: BinaryObjectBuilder: policy of reusing

dsetrakyan
Sergey, why not prohibit any reuse of the builder and throw exception right
away?

On Wed, Jul 26, 2017 at 6:20 AM, Sergey Chugunov <[hidden email]>
wrote:

> Hello folks,
>
> Recently I filed a ticket [1] with very simple test where correct usage of
> BinaryObjectBuilder is vague.
>
> The issue boils down to the fact that it is unclear from documentation and
> behavior whether reusing of BinaryObjectBuilder is allowed.
>
> Let's discuss here what is the correct behavior and how to fix the issue.
>
> For sure documentation on BinaryObjectBuilder must be updated as well.
>
> [1] https://issues.apache.org/jira/browse/IGNITE-5839
>
Reply | Threaded
Open this post in threaded view
|

Re: BinaryObjectBuilder: policy of reusing

Pavel Tupitsyn
BinaryObjectBuilder reuse should be allowed, performance is an important
point of this mechanism.
Creating a new builder just to modify a single field is wasteful.

Well-known builders, such as StringBuilder, are reusable.

Pavel

On Thu, Jul 27, 2017 at 10:51 AM, Dmitriy Setrakyan <[hidden email]>
wrote:

> Sergey, why not prohibit any reuse of the builder and throw exception right
> away?
>
> On Wed, Jul 26, 2017 at 6:20 AM, Sergey Chugunov <
> [hidden email]>
> wrote:
>
> > Hello folks,
> >
> > Recently I filed a ticket [1] with very simple test where correct usage
> of
> > BinaryObjectBuilder is vague.
> >
> > The issue boils down to the fact that it is unclear from documentation
> and
> > behavior whether reusing of BinaryObjectBuilder is allowed.
> >
> > Let's discuss here what is the correct behavior and how to fix the issue.
> >
> > For sure documentation on BinaryObjectBuilder must be updated as well.
> >
> > [1] https://issues.apache.org/jira/browse/IGNITE-5839
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: BinaryObjectBuilder: policy of reusing

dsetrakyan
On Thu, Jul 27, 2017 at 3:14 AM, Pavel Tupitsyn <[hidden email]>
wrote:

> BinaryObjectBuilder reuse should be allowed, performance is an important
> point of this mechanism.
> Creating a new builder just to modify a single field is wasteful.
>
> Well-known builders, such as StringBuilder, are reusable.
>

In this case, what is preventing the binary builder from being reusable?

The ticket filed by Sergey states that there is a bug in the builder, but
also suggests that we should create a new builder all the time. It sounds
that it is not a good approach then.


>
> Pavel
>
> On Thu, Jul 27, 2017 at 10:51 AM, Dmitriy Setrakyan <[hidden email]
> >
> wrote:
>
> > Sergey, why not prohibit any reuse of the builder and throw exception
> right
> > away?
> >
> > On Wed, Jul 26, 2017 at 6:20 AM, Sergey Chugunov <
> > [hidden email]>
> > wrote:
> >
> > > Hello folks,
> > >
> > > Recently I filed a ticket [1] with very simple test where correct usage
> > of
> > > BinaryObjectBuilder is vague.
> > >
> > > The issue boils down to the fact that it is unclear from documentation
> > and
> > > behavior whether reusing of BinaryObjectBuilder is allowed.
> > >
> > > Let's discuss here what is the correct behavior and how to fix the
> issue.
> > >
> > > For sure documentation on BinaryObjectBuilder must be updated as well.
> > >
> > > [1] https://issues.apache.org/jira/browse/IGNITE-5839
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: BinaryObjectBuilder: policy of reusing

Vladimir Ozerov
Let's just fix this bug and allow BinaryObjectBuilder re-use.

On Thu, Jul 27, 2017 at 11:43 AM, Dmitriy Setrakyan <[hidden email]>
wrote:

> On Thu, Jul 27, 2017 at 3:14 AM, Pavel Tupitsyn <[hidden email]>
> wrote:
>
> > BinaryObjectBuilder reuse should be allowed, performance is an important
> > point of this mechanism.
> > Creating a new builder just to modify a single field is wasteful.
> >
> > Well-known builders, such as StringBuilder, are reusable.
> >
>
> In this case, what is preventing the binary builder from being reusable?
>
> The ticket filed by Sergey states that there is a bug in the builder, but
> also suggests that we should create a new builder all the time. It sounds
> that it is not a good approach then.
>
>
> >
> > Pavel
> >
> > On Thu, Jul 27, 2017 at 10:51 AM, Dmitriy Setrakyan <
> [hidden email]
> > >
> > wrote:
> >
> > > Sergey, why not prohibit any reuse of the builder and throw exception
> > right
> > > away?
> > >
> > > On Wed, Jul 26, 2017 at 6:20 AM, Sergey Chugunov <
> > > [hidden email]>
> > > wrote:
> > >
> > > > Hello folks,
> > > >
> > > > Recently I filed a ticket [1] with very simple test where correct
> usage
> > > of
> > > > BinaryObjectBuilder is vague.
> > > >
> > > > The issue boils down to the fact that it is unclear from
> documentation
> > > and
> > > > behavior whether reusing of BinaryObjectBuilder is allowed.
> > > >
> > > > Let's discuss here what is the correct behavior and how to fix the
> > issue.
> > > >
> > > > For sure documentation on BinaryObjectBuilder must be updated as
> well.
> > > >
> > > > [1] https://issues.apache.org/jira/browse/IGNITE-5839
> > > >
> > >
> >
>