Package org.apache.hadoop.fs.s3a.impl
Class InputStreamCallbacksImpl
java.lang.Object
org.apache.hadoop.fs.s3a.impl.InputStreamCallbacksImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,ObjectInputStreamCallbacks
Callbacks for object stream operations.
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamCallbacksImpl(org.apache.hadoop.fs.store.audit.AuditSpan auditSpan, S3AStore store, S3AFileSystemOperations fsOperations, ThreadPoolExecutor threadPool) Create. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the audit span.software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse>getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest request) Execute the request.software.amazon.awssdk.services.s3.model.GetObjectRequest.BuilderCreate a GET request builder.<T> CompletableFuture<T>submit(org.apache.hadoop.util.functional.CallableRaisingIOE<T> operation) Submit some asynchronous work, for example, draining a stream.
-
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 operationsfsOperations- crypto FS operations.threadPool- thread pool for async operations.
-
-
Method Details
-
close
public void close()Closes the audit span.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
newGetRequestBuilder
public software.amazon.awssdk.services.s3.model.GetObjectRequest.Builder newGetRequestBuilder(String key) Description copied from interface:ObjectInputStreamCallbacksCreate a GET request builder.- Specified by:
newGetRequestBuilderin interfaceObjectInputStreamCallbacks- 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:ObjectInputStreamCallbacksExecute 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:
getObjectin interfaceObjectInputStreamCallbacks- 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:ObjectInputStreamCallbacksSubmit some asynchronous work, for example, draining a stream.- Specified by:
submitin interfaceObjectInputStreamCallbacks- Type Parameters:
T- return type- Parameters:
operation- operation to invoke- Returns:
- a future.
-