Package org.apache.bookkeeper.client.api
Interface Handle
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ReadHandle,WriteAdvHandle,WriteHandle
- All Known Implementing Classes:
LedgerHandle,LedgerHandleAdv,ReadOnlyLedgerHandle
Handle to manage an open ledger.
- Since:
- 4.6
-
Method Details
-
getId
long getId()Get the id of the current ledger.- Returns:
- the id of the ledger
-
close
Close this handle synchronously.- Specified by:
closein interfaceAutoCloseable- Throws:
BKExceptionInterruptedException- See Also:
-
closeAsync
CompletableFuture<Void> closeAsync()Asynchronous close the handle.- Returns:
- an handle to access the result of the operation
-
getLedgerMetadata
LedgerMetadata getLedgerMetadata()Returns the metadata of this ledger.This call only retrieves the metadata cached locally. If there is any metadata updated, the read handle will receive the metadata updates and update the metadata locally. The metadata notification can be deplayed, so it is possible you can receive a stale copy of ledger metadata from this call.
- Returns:
- the metadata of this ledger.
-