Class BufferWriteAsyncResponseTransformer<ResponseT>

java.lang.Object
io.trino.plugin.exchange.filesystem.s3.BufferWriteAsyncResponseTransformer<ResponseT>
Type Parameters:
ResponseT - Response POJO type.
All Implemented Interfaces:
software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>

public final class BufferWriteAsyncResponseTransformer<ResponseT> extends Object implements software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>
An implementation of AsyncResponseTransformer that writes data to the specified range of the given buffer. This class mimics the implementation of ByteArrayAsyncResponseTransformer but avoids memory copying.
  • Constructor Details

    • BufferWriteAsyncResponseTransformer

      public BufferWriteAsyncResponseTransformer(byte[] buffer, int offset)
  • Method Details

    • prepare

      public CompletableFuture<ResponseT> prepare()
      Specified by:
      prepare in interface software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>
    • onResponse

      public void onResponse(ResponseT response)
      Specified by:
      onResponse in interface software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>
    • onStream

      public void onStream(software.amazon.awssdk.core.async.SdkPublisher<ByteBuffer> publisher)
      Specified by:
      onStream in interface software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>
    • exceptionOccurred

      public void exceptionOccurred(Throwable throwable)
      Specified by:
      exceptionOccurred in interface software.amazon.awssdk.core.async.AsyncResponseTransformer<ResponseT,ResponseT>