@Unstable @VisibleForTesting public class LedgerMetadataBuilder {
@Unstable public class BKException extends Exception { static final Function<Throwable, BKException> HANDLER = cause -> {
@Unstable public interface ReadHandle extends Handle {
@Unstable public interface WriteHandle extends ReadHandle, ForceableHandle {
@Unstable public interface LedgerMetadata {
@Unstable public interface WriteAdvHandle extends ReadHandle, ForceableHandle {
@Unstable public interface CreateBuilder extends OpBuilder<WriteHandle> {
@Unstable public interface BookKeeperBuilder {
@Unstable public interface LedgerEntry extends AutoCloseable {
@Unstable public interface BookKeeper extends AutoCloseable {
@Unstable public interface OpenBuilder extends OpBuilder<ReadHandle> {
@Unstable public interface Handle extends AutoCloseable {
/** * Provide the ability to enforce durability guarantees to the writer. * * @see WriteAdvHandle * @see WriteHandle * * @since 4.8 */ @Public @Unstable public interface ForceableHandle { /** * Enforce durability to the entries written by this handle. * <p>This API is useful with {@link WriteFlag#DEFERRED_SYNC}, because with * that flag writes are acknowledged by the bookie without waiting for a * durable write * </p> * * @return an handle to the result */ CompletableFuture<Void> force(); }
/** * Base interface for builders. * * @since 4.6 */ @Public @Unstable public interface OpBuilder<T> { /** * Start the operation and return an handle to the result. * * @return an handle to access the result of the operation * * @see FutureUtils#result(java.util.concurrent.CompletableFuture) to have a simple method to access the result */ CompletableFuture<T> execute(); }
/** * Builder-style interface to create new ledgers. * * @since 4.6 * @see BookKeeper#newCreateLedgerOp() */ @Public @Unstable public interface CreateAdvBuilder extends OpBuilder<WriteAdvHandle> { /** * Set a fixed ledgerId for the newly created ledger. If no explicit ledgerId is passed a new ledger id will be * assigned automatically. * * @param ledgerId * * @return the builder itself */ CreateAdvBuilder withLedgerId(long ledgerId); }
/** * Builder-style interface to delete exiting ledgers. * * @since 4.6 */ @Public @Unstable public interface DeleteBuilder extends OpBuilder<Void> { /** * Set the id of the ledger to be deleted. * * @param ledgerId * * @return the builder itself */ DeleteBuilder withLedgerId(long ledgerId); }