Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sync variants of all methods in handles #1288

Closed
wants to merge 4 commits into from

Conversation

ivankelly
Copy link
Contributor

As discussed on the mailing list [1], this patch removes the
inconsistency around the naming of the close call on the new handle
APIs, by creating sync versions of each async calls, and renaming the
async versions to have the suffix "Async".

Most of the changes are very mechanical - just a copy of the old
method and some small fixups the javadoc. One thing to note is that
I've made a copy of the close and closeAsync methods in the
WriteHandle interface, so that the ReadHandle and Handle javadoc for
these methods do not have to talk about what it means to close/seal a
ledger.

Another change is that I've removed the SneakyThrows from close, that
would have also been needed on the other sync methods. Instead, I pass a
exception handler to FutureUtils which generates a BKException.

[1] https://lists.apache.org/thread.html/c3784cffb949438510d21e5eac8c0351865c6748c42c380e673a60db@%3Cdev.bookkeeper.apache.org%3E

As discussed on the mailing list [1], this patch removes the
inconsistency around the naming of the close call on the new handle
APIs, by creating sync versions of each async calls, and renaming the
async versions to have the suffix "Async".

Most of the changes are very mechanical - just a copy of the old
method and some small fixups the javadoc. One thing to note is that
I've made a copy of the close and closeAsync methods in the
WriteHandle interface, so that the ReadHandle and Handle javadoc for
these methods do not have to talk about what it means to close/seal a
ledger.

Another change is that I've removed the SneakyThrows from close, that
would have also been needed on the other sync methods. Instead, I pass a
exception handler to FutureUtils which generates a BKException.

[1] https://lists.apache.org/thread.html/c3784cffb949438510d21e5eac8c0351865c6748c42c380e673a60db@%3Cdev.bookkeeper.apache.org%3E
@ivankelly ivankelly self-assigned this Mar 23, 2018
Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change looks good. one comment.

@@ -21,7 +21,7 @@
package org.apache.bookkeeper.client.api;

import java.util.concurrent.CompletableFuture;
import lombok.SneakyThrows;
import org.apache.bookkeeper.client.impl.BKExceptionHandler;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make BKExceptionHandler.HANDLER as part of BKException. rather than having a separate class. this also prevent api package referencing impl package, which allows producing a clean api package.

@ivankelly
Copy link
Contributor Author

@sijie updated

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Thank you Ivan

@sijie
Copy link
Member

sijie commented Mar 24, 2018

@ivankelly you need to fix some tests.

@eolivelli
Copy link
Contributor

@ivankelly this is an important change to the public API.
I am totally fine with this change.

But shouldn't it need some kind of discussion/vote on the mailing list ?

Cc @sijie

@eolivelli
Copy link
Contributor

retest this please

@eolivelli
Copy link
Contributor

Sorry, I was not clear. The discussion happened but not in the usual form during last period (like BPs...) and no formal vote thread has been sent.

@sijie
Copy link
Member

sijie commented Mar 26, 2018

@eolivelli - I think this is not proposing a brand new API. The original new API was introduced in a BP, this change here is more a incremental change to fix the inconsistency in the new API. so I don't think it worth a BP. but if you really feel strong about it, we can do a BP.

@eolivelli
Copy link
Contributor

eolivelli commented Mar 27, 2018

Makes sense to me

I feel fine with merging this PR and move forward.

@eolivelli eolivelli closed this Mar 27, 2018
@eolivelli
Copy link
Contributor

I did not want to close this one

@eolivelli eolivelli reopened this Mar 27, 2018
@ivankelly
Copy link
Contributor Author

retest this please

@ivankelly
Copy link
Contributor Author

@eolivelli there was a integration test failure, so kicking again. I think it's unrelated, but want to be sure. Also, too late in the day to dig deeper :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants