Package org.apache.bookkeeper.client
Class PulsarMockLedgerHandle
java.lang.Object
org.apache.bookkeeper.client.LedgerHandle
org.apache.bookkeeper.client.PulsarMockLedgerHandle
- All Implemented Interfaces:
AutoCloseable,org.apache.bookkeeper.client.api.ForceableHandle,org.apache.bookkeeper.client.api.Handle,org.apache.bookkeeper.client.api.ReadHandle,org.apache.bookkeeper.client.api.WriteHandle
public class PulsarMockLedgerHandle
extends org.apache.bookkeeper.client.LedgerHandle
Mock BK
LedgerHandle. Used by PulsarMockBookKeeper.-
Field Summary
Fields inherited from class org.apache.bookkeeper.client.LedgerHandle
INVALID_ENTRY_ID, INVALID_LEDGER_ID -
Constructor Summary
ConstructorsConstructorDescriptionPulsarMockLedgerHandle(PulsarMockBookKeeper bk, long id, org.apache.bookkeeper.client.BookKeeper.DigestType digest, byte[] passwd) -
Method Summary
Modifier and TypeMethodDescriptionlongaddEntry(byte[] data) voidasyncAddEntry(byte[] data, int offset, int length, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) voidasyncAddEntry(byte[] data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) voidasyncAddEntry(io.netty.buffer.ByteBuf data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) voidasyncClose(org.apache.bookkeeper.client.AsyncCallback.CloseCallback cb, Object ctx) voidasyncReadEntries(long firstEntry, long lastEntry, org.apache.bookkeeper.client.AsyncCallback.ReadCallback cb, Object ctx) longgetId()longlongbooleanisClosed()CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries>readAsync(long firstEntry, long lastEntry) CompletableFuture<org.apache.bookkeeper.client.api.LastConfirmedAndEntry>readLastAddConfirmedAndEntryAsync(long entryId, long timeOutInMillis, boolean parallel) CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries>readUnconfirmedAsync(long firstEntry, long lastEntry) Methods inherited from class org.apache.bookkeeper.client.LedgerHandle
addEntry, addEntry, addEntry, appendAsync, asyncAddEntry, asyncAddEntry, asyncAddEntry, asyncAddEntry, asyncBatchReadEntries, asyncBatchReadUnconfirmedEntries, asyncReadExplicitLastConfirmed, asyncReadLastConfirmed, asyncReadLastConfirmedAndEntry, asyncReadLastEntry, asyncReadUnconfirmedEntries, asyncTryReadLastConfirmed, batchReadAsync, batchReadEntries, batchReadUnconfirmedEntries, close, closeAsync, doAsyncAddEntry, force, getCtime, getCustomMetadata, getLastAddPushed, getLedgerKey, getLedgerMetadata, getNumBookies, getNumFragments, getPendingAddOps, getWriteFlags, initializeWriteHandleState, readEntries, readExplicitLastConfirmed, readLastConfirmed, readLastEntry, readUnconfirmedEntries, tryReadLastConfirmed, waitForWritableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.client.api.ReadHandle
batchRead, read, readLastAddConfirmed, readLastAddConfirmedAndEntry, readUnconfirmed, tryReadLastAddConfirmedMethods inherited from interface org.apache.bookkeeper.client.api.WriteHandle
append, append, append, append, appendAsync, appendAsync, appendAsync
-
Constructor Details
-
PulsarMockLedgerHandle
public PulsarMockLedgerHandle(PulsarMockBookKeeper bk, long id, org.apache.bookkeeper.client.BookKeeper.DigestType digest, byte[] passwd) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
-
Method Details
-
asyncClose
- Overrides:
asyncClosein classorg.apache.bookkeeper.client.LedgerHandle
-
asyncReadEntries
public void asyncReadEntries(long firstEntry, long lastEntry, org.apache.bookkeeper.client.AsyncCallback.ReadCallback cb, Object ctx) - Overrides:
asyncReadEntriesin classorg.apache.bookkeeper.client.LedgerHandle
-
addEntry
public long addEntry(byte[] data) throws InterruptedException, org.apache.bookkeeper.client.BKException - Overrides:
addEntryin classorg.apache.bookkeeper.client.LedgerHandle- Throws:
InterruptedExceptionorg.apache.bookkeeper.client.BKException
-
asyncAddEntry
public void asyncAddEntry(byte[] data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) - Overrides:
asyncAddEntryin classorg.apache.bookkeeper.client.LedgerHandle
-
asyncAddEntry
public void asyncAddEntry(byte[] data, int offset, int length, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) - Overrides:
asyncAddEntryin classorg.apache.bookkeeper.client.LedgerHandle
-
asyncAddEntry
public void asyncAddEntry(io.netty.buffer.ByteBuf data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, Object ctx) - Overrides:
asyncAddEntryin classorg.apache.bookkeeper.client.LedgerHandle
-
getId
public long getId()- Specified by:
getIdin interfaceorg.apache.bookkeeper.client.api.Handle- Overrides:
getIdin classorg.apache.bookkeeper.client.LedgerHandle
-
getLastAddConfirmed
public long getLastAddConfirmed()- Specified by:
getLastAddConfirmedin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
getLastAddConfirmedin classorg.apache.bookkeeper.client.LedgerHandle
-
getLength
public long getLength()- Specified by:
getLengthin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
getLengthin classorg.apache.bookkeeper.client.LedgerHandle
-
readAsync
public CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries> readAsync(long firstEntry, long lastEntry) - Specified by:
readAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
readAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-
readUnconfirmedAsync
public CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries> readUnconfirmedAsync(long firstEntry, long lastEntry) - Specified by:
readUnconfirmedAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
readUnconfirmedAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-
readLastAddConfirmedAsync
- Specified by:
readLastAddConfirmedAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
readLastAddConfirmedAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-
tryReadLastAddConfirmedAsync
- Specified by:
tryReadLastAddConfirmedAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
tryReadLastAddConfirmedAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
isClosedin classorg.apache.bookkeeper.client.LedgerHandle
-
readLastAddConfirmedAndEntryAsync
public CompletableFuture<org.apache.bookkeeper.client.api.LastConfirmedAndEntry> readLastAddConfirmedAndEntryAsync(long entryId, long timeOutInMillis, boolean parallel) - Specified by:
readLastAddConfirmedAndEntryAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
readLastAddConfirmedAndEntryAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-