You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2019/08/01 08:45:34 UTC
[GitHub] [bookkeeper] eolivelli commented on issue #2138: Discuss the
lifecycle of application data bytebuffer when adding new entries to ledger
eolivelli commented on issue #2138: Discuss the lifecycle of application data bytebuffer when adding new entries to ledger
URL: https://github.com/apache/bookkeeper/issues/2138#issuecomment-517190097
@sijie
I think that usually in Java when you pass (byte[],int,int) reference to a method like OutputStream#**write**(byte[], int, int) you expect to be able to recycle that byte[] array after returning from that call or catching an exception.
In this case our blocking API is not following the same behavior, if you have AQ<WQ you must not use the byte[] anymore, or at least never write to it (this is @karanmehta93 case).
For non blocking (async) APIs it is less obvious how it should work but generally I would expect to be able to reuse my buffer as soon as the callback is invoked.
> They expect the byte[] arrays are not be shared or reused.
Can you please give me an example in the JDK? I can't recall any example. Maybe I am only missing some point of view.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services