/** * Async Callback for deleting ledgers. * * @since 4.0 */ @InterfaceAudience.Public @InterfaceStability.Stable interface DeleteCallback { /** * Callback definition for delete operations. * * @param rc * return code * @param ctx * context object */ void deleteComplete(int rc, Object ctx); }
@Public @Evolving public interface OpFactory<K, V> {
/** * 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); }
/** * Async Callback for recovering ledgers. * * @since 4.0 */ @InterfaceAudience.Public @InterfaceStability.Stable interface RecoverCallback { /** * Callback definition for bookie recover operations. * * @param rc * return code * @param ctx * context object */ void recoverComplete(int rc, Object ctx); }
/** * A compare operator used in a {@link org.apache.bookkeeper.api.kv.Txn}. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface CompareOp<K, V> extends AutoCloseable { CompareTarget target(); CompareResult result(); K key(); V value(); long revision(); @Override void close(); }
/** * 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); }
/** * A mvcc store that supports synchronous operations. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface MVCCStore<K, V> extends StateStore, MVCCStoreWriteView<K, V>, MVCCStoreReadView<K, V> { /** * Return the operator factory to build operators. * * @return operator factory. */ OpFactory<K, V> getOpFactory(); }
/** * Iterator to iterate key/value pairs of the read-view of a k/v store. */ @Public @Evolving public interface KVIterator<K, V> extends Iterator<KV<K, V>>, AutoCloseable { /** * Close the iterator to release resources held by this iterator. * * <p>The users of this interface should be responsible for closing the iterator. */ @Override void close(); }
/** * The read view for a {@link MVCCAsyncStore}. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface MVCCAsyncStoreReadView<K, V> { CompletableFuture<V> get(K key); CompletableFuture<KeyValue<K, V>> getKeyValue(K key); CompletableFuture<List<KeyValue<K, V>>> range(K key, K endKey); CompletableFuture<RangeResult<K, V>> range(RangeOp<K, V> rangeOp); }
/** * A put operator that update a value associated with a given key. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface PutOp<K, V> extends Op<K, V> { K key(); V value(); PutOption<K> option(); }
/** * The read view for a mvcc store. * * @param <K> key type. * @param <V> value type. */ @Public @Evolving public interface MVCCStoreReadView<K, V> { RangeResult<K, V> range(RangeOp<K, V> rangeOp); }
/** * A key/value state store that supports put/get/delete/range operations. */ @Public @Evolving public interface KVStore<K, V> extends StateStore, KVStoreWriteView<K, V>, KVStoreReadView<K, V> { }
/** * A range operation. */ @Public @Evolving public interface RangeOp<K, V> extends Op<K, V> { K key(); RangeOption<K> option(); }
/** * A class represents a key value pair. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface KV<K, V> { K key(); V value(); }
/** * Interface of kv client talking to partitioned table. */ @InterfaceAudience.Public @InterfaceStability.Evolving public interface PTable<K, V> extends PTableReadView<K, V>, PTableWriteView<K, V> { }
/** * Position in a stream. */ @Public @Evolving public interface Position { }
/** * Abstract Operation. */ @Public @Evolving public interface Op<K, V> extends AutoCloseable { OpType type(); @Override void close(); }
/** * A put operator that update a value associated with a given key. * * @param <K> key type * @param <V> value type */ @Public @Evolving public interface IncrementOp<K, V> extends Op<K, V> { K key(); long amount(); IncrementOption<K> option(); }
/** * Interface of kv client talking to partitioned table. */ @InterfaceAudience.Public @InterfaceStability.Evolving public interface Table<K, V> extends TableReadView<K, V>, TableWriteView<K, V> { }