Class RequestBatchManager<RequestT,ResponseT,BatchResponseT>
java.lang.Object
software.amazon.awssdk.services.sqs.internal.batchmanager.RequestBatchManager<RequestT,ResponseT,BatchResponseT>
- Direct Known Subclasses:
ChangeMessageVisibilityBatchManager,DeleteMessageBatchManager,SendMessageBatchManager
@SdkInternalApi
public abstract class RequestBatchManager<RequestT,ResponseT,BatchResponseT>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RequestBatchConfigurationstatic final Consumer<AwsRequestOverrideConfiguration.Builder> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRequestBatchManager(RequestBatchConfiguration overrideConfiguration, ScheduledExecutorService scheduledExecutor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CompletableFuture<BatchResponseT>batchAndSend(List<IdentifiableMessage<RequestT>> identifiedRequests, String batchKey) batchRequest(RequestT request) protected voidPhase 2 of shutdown.protected CompletableFuture<Void>Phase 1 of shutdown, non-blocking.protected abstract StringgetBatchKey(RequestT request) protected abstract List<Either<IdentifiableMessage<ResponseT>,IdentifiableMessage<Throwable>>> mapBatchResponse(BatchResponseT batchResponse) protected Duration
-
Field Details
-
USER_AGENT_APPLIER
-
batchConfiguration
-
-
Constructor Details
-
RequestBatchManager
protected RequestBatchManager(RequestBatchConfiguration overrideConfiguration, ScheduledExecutorService scheduledExecutor)
-
-
Method Details
-
batchRequest
-
batchAndSend
protected abstract CompletableFuture<BatchResponseT> batchAndSend(List<IdentifiableMessage<RequestT>> identifiedRequests, String batchKey) -
getBatchKey
-
mapBatchResponse
protected abstract List<Either<IdentifiableMessage<ResponseT>,IdentifiableMessage<Throwable>>> mapBatchResponse(BatchResponseT batchResponse) -
closeAndDispatch
Phase 1 of shutdown, non-blocking. Marks the manager closed, dispatches every buffered batch (each exactly once), and returns a future that completes when all in-flight sends dispatched here have completed, so the caller can wait on it. Does not block and does not cancel; a second call is a no-op that returns an already-completed future. -
cancelPending
protected void cancelPending()Phase 2 of shutdown. Cancels any requests still pending after the timeout, surfacingCancellationExceptionto their callers, and releases the buffers. Idempotent. -
shutdownTimeout
-