eolivelli commented on a change in pull request #510: Issue-605 BP-15 New
CreateLedger API
URL: https://github.com/apache/bookkeeper/pull/510#discussion_r142372593
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerDeleteOp.java
##########
@@ -94,4 +97,42 @@ public void safeOperationComplete(int rc, Void result) {
public String toString() {
return String.format("LedgerDeleteOp(%d)", ledgerId);
}
+
+ public static class DeleteBuilderImpl implements DeleteBuilder {
+
+ private long builderLedgerId = -1;
+ private final BookKeeper bk;
+
+ public DeleteBuilderImpl(BookKeeper bk) {
+ this.bk = bk;
+ }
+
+ @Override
+ public DeleteBuilder withLedgerId(long ledgerId) {
+ this.builderLedgerId = ledgerId;
+ return this;
+ }
+
+ @Override
+ public CompletableFuture<?> execute() {
+ CompletableFuture<Void> counter = new CompletableFuture<>();
+ delete(builderLedgerId, new SyncDeleteCallback(), counter);
+ return counter;
+ }
+
+ private void delete(long ledgerId, AsyncCallback.DeleteCallback cb,
Object ctx) {
+ LedgerDeleteOp op = new LedgerDeleteOp(bk, ledgerId, cb, ctx);
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services