Interface WriteAdvHandle

All Superinterfaces:
AutoCloseable, ForceableHandle, Handle, ReadHandle
All Known Implementing Classes:
LedgerHandleAdv

@Public @Unstable public interface WriteAdvHandle extends ReadHandle, ForceableHandle
Provide write access to a ledger. Using WriteAdvHandler the writer MUST explicitly set an entryId. Beware that the write for a given entryId will be acknowledged if and only if all entries up to entryId - 1 have been acknowledged too (expected from entryId 0)
Since:
4.6
See Also:
  • Method Details

    • writeAsync

      default CompletableFuture<Long> writeAsync(long entryId, ByteBuffer data)
      Add entry asynchronously to an open ledger.
      Parameters:
      entryId - entryId to be added
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      an handle to the result, in case of success it will return the same value of param entryId.
    • write

      default long write(long entryId, ByteBuffer data) throws BKException, InterruptedException
      Add entry synchronously to an open ledger.
      Parameters:
      entryId - entryId to be added
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      the same value of param entryId.
      Throws:
      BKException
      InterruptedException
    • writeAsync

      default CompletableFuture<Long> writeAsync(long entryId, byte[] data)
      Add entry asynchronously to an open ledger.
      Parameters:
      entryId - entryId to be added.
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      an handle to the result, in case of success it will return the same value of param entryId.
    • write

      default long write(long entryId, byte[] data) throws BKException, InterruptedException
      Add entry synchronously to an open ledger.
      Parameters:
      entryId - entryId to be added.
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      same value of param entryId.
      Throws:
      BKException
      InterruptedException
    • writeAsync

      default CompletableFuture<Long> writeAsync(long entryId, byte[] data, int offset, int length)
      Add entry asynchronously to an open ledger.
      Parameters:
      entryId - entryId to be added.
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      offset - the offset of the bytes array
      length - the length to data to write
      Returns:
      an handle to the result, in case of success it will return the same value of param entryId.
    • write

      default long write(long entryId, byte[] data, int offset, int length) throws BKException, InterruptedException
      Add entry synchronously to an open ledger.
      Parameters:
      entryId - entryId to be added.
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      offset - the offset of the bytes array
      length - the length to data to write
      Returns:
      the same value of param entryId.
      Throws:
      BKException
      InterruptedException
    • writeAsync

      CompletableFuture<Long> writeAsync(long entryId, io.netty.buffer.ByteBuf data)
      Add entry asynchronously to an open ledger.
      Parameters:
      entryId - entryId to be added
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      an handle to the result, in case of success it will return the same value of param entryId
    • write

      default long write(long entryId, io.netty.buffer.ByteBuf data) throws BKException, InterruptedException
      Add entry asynchronously to an open ledger.
      Parameters:
      entryId - entryId to be added
      data - array of bytes to be written do not reuse the buffer, bk-client will release it appropriately.
      Returns:
      the same value of param entryId
      Throws:
      BKException
      InterruptedException