Class InputStreamCallbacksImpl

java.lang.Object
org.apache.hadoop.fs.s3a.impl.InputStreamCallbacksImpl
All Implemented Interfaces:
Closeable, AutoCloseable, ObjectInputStreamCallbacks

public class InputStreamCallbacksImpl extends Object implements ObjectInputStreamCallbacks
Callbacks for object stream operations.
  • Constructor Details

    • InputStreamCallbacksImpl

      public InputStreamCallbacksImpl(org.apache.hadoop.fs.store.audit.AuditSpan auditSpan, S3AStore store, S3AFileSystemOperations fsOperations, ThreadPoolExecutor threadPool)
      Create.
      Parameters:
      auditSpan - Audit span to activate before each call.
      store - store operations
      fsOperations - crypto FS operations.
      threadPool - thread pool for async operations.
  • Method Details

    • close

      public void close()
      Closes the audit span.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • newGetRequestBuilder

      public software.amazon.awssdk.services.s3.model.GetObjectRequest.Builder newGetRequestBuilder(String key)
      Description copied from interface: ObjectInputStreamCallbacks
      Create a GET request builder.
      Specified by:
      newGetRequestBuilder in interface ObjectInputStreamCallbacks
      Parameters:
      key - object key
      Returns:
      the request builder
    • getObject

      public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse> getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest request) throws IOException
      Description copied from interface: ObjectInputStreamCallbacks
      Execute the request. When CSE is enabled with reading of unencrypted data, The object is checked if it is encrypted and if so, the request is made with encrypted S3 client. If the object is not encrypted, the request is made with unencrypted s3 client.
      Specified by:
      getObject in interface ObjectInputStreamCallbacks
      Parameters:
      request - the request
      Returns:
      the response
      Throws:
      IOException - on any failure.
    • submit

      public <T> CompletableFuture<T> submit(org.apache.hadoop.util.functional.CallableRaisingIOE<T> operation)
      Description copied from interface: ObjectInputStreamCallbacks
      Submit some asynchronous work, for example, draining a stream.
      Specified by:
      submit in interface ObjectInputStreamCallbacks
      Type Parameters:
      T - return type
      Parameters:
      operation - operation to invoke
      Returns:
      a future.