Package org.apache.bookkeeper.client
Class PulsarMockLedgerHandle
- java.lang.Object
-
- org.apache.bookkeeper.client.LedgerHandle
-
- org.apache.bookkeeper.client.PulsarMockLedgerHandle
-
- All Implemented Interfaces:
java.lang.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.LedgerHandleMock BKLedgerHandle. Used byPulsarMockBookKeeper.
-
-
Constructor Summary
Constructors Constructor Description PulsarMockLedgerHandle(PulsarMockBookKeeper bk, long id, org.apache.bookkeeper.client.BookKeeper.DigestType digest, byte[] passwd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddEntry(byte[] data)voidasyncAddEntry(byte[] data, int offset, int length, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, java.lang.Object ctx)voidasyncAddEntry(byte[] data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, java.lang.Object ctx)voidasyncAddEntry(io.netty.buffer.ByteBuf data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, java.lang.Object ctx)voidasyncClose(org.apache.bookkeeper.client.AsyncCallback.CloseCallback cb, java.lang.Object ctx)voidasyncReadEntries(long firstEntry, long lastEntry, org.apache.bookkeeper.client.AsyncCallback.ReadCallback cb, java.lang.Object ctx)longgetId()longgetLastAddConfirmed()longgetLength()booleanisClosed()java.util.concurrent.CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries>readAsync(long firstEntry, long lastEntry)java.util.concurrent.CompletableFuture<org.apache.bookkeeper.client.api.LastConfirmedAndEntry>readLastAddConfirmedAndEntryAsync(long entryId, long timeOutInMillis, boolean parallel)java.util.concurrent.CompletableFuture<java.lang.Long>readLastAddConfirmedAsync()java.util.concurrent.CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries>readUnconfirmedAsync(long firstEntry, long lastEntry)java.util.concurrent.CompletableFuture<java.lang.Long>tryReadLastAddConfirmedAsync()-
Methods inherited from class org.apache.bookkeeper.client.LedgerHandle
addEntry, addEntry, addEntry, appendAsync, asyncAddEntry, asyncAddEntry, asyncAddEntry, asyncAddEntry, asyncReadExplicitLastConfirmed, asyncReadLastConfirmed, asyncReadLastConfirmedAndEntry, asyncReadLastEntry, asyncReadUnconfirmedEntries, asyncTryReadLastConfirmed, close, closeAsync, doAsyncAddEntry, force, getCtime, getCustomMetadata, getLastAddPushed, getLedgerKey, getLedgerMetadata, getNumBookies, getNumFragments, getWriteFlags, initializeWriteHandleState, readEntries, readExplicitLastConfirmed, readLastConfirmed, readLastEntry, readUnconfirmedEntries, tryReadLastConfirmed, waitForWritable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
PulsarMockLedgerHandle
public PulsarMockLedgerHandle(PulsarMockBookKeeper bk, long id, org.apache.bookkeeper.client.BookKeeper.DigestType digest, byte[] passwd) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
-
Method Detail
-
asyncClose
public void asyncClose(org.apache.bookkeeper.client.AsyncCallback.CloseCallback cb, java.lang.Object ctx)- Overrides:
asyncClosein classorg.apache.bookkeeper.client.LedgerHandle
-
asyncReadEntries
public void asyncReadEntries(long firstEntry, long lastEntry, org.apache.bookkeeper.client.AsyncCallback.ReadCallback cb, java.lang.Object ctx)- Overrides:
asyncReadEntriesin classorg.apache.bookkeeper.client.LedgerHandle
-
addEntry
public long addEntry(byte[] data) throws java.lang.InterruptedException, org.apache.bookkeeper.client.BKException- Overrides:
addEntryin classorg.apache.bookkeeper.client.LedgerHandle- Throws:
java.lang.InterruptedExceptionorg.apache.bookkeeper.client.BKException
-
asyncAddEntry
public void asyncAddEntry(byte[] data, org.apache.bookkeeper.client.AsyncCallback.AddCallback cb, java.lang.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, java.lang.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, java.lang.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 java.util.concurrent.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 java.util.concurrent.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
public java.util.concurrent.CompletableFuture<java.lang.Long> readLastAddConfirmedAsync()
- Specified by:
readLastAddConfirmedAsyncin interfaceorg.apache.bookkeeper.client.api.ReadHandle- Overrides:
readLastAddConfirmedAsyncin classorg.apache.bookkeeper.client.LedgerHandle
-
tryReadLastAddConfirmedAsync
public java.util.concurrent.CompletableFuture<java.lang.Long> 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 java.util.concurrent.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
-
-