From 38cc295f294093c7f9487dfcc33edbbf8777119c Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 3 Aug 2021 12:40:01 -0400 Subject: [PATCH] Renaming batch-utilities to batch-manager in docs, updating code snippets in design doc to reflect new decisions --- .../DecisionLog.md | 0 .../Design.md | 53 ++++++++----------- 2 files changed, 21 insertions(+), 32 deletions(-) rename docs/design/core/{batch-utilities => batch-manager}/DecisionLog.md (100%) rename docs/design/core/{batch-utilities => batch-manager}/Design.md (88%) diff --git a/docs/design/core/batch-utilities/DecisionLog.md b/docs/design/core/batch-manager/DecisionLog.md similarity index 100% rename from docs/design/core/batch-utilities/DecisionLog.md rename to docs/design/core/batch-manager/DecisionLog.md diff --git a/docs/design/core/batch-utilities/Design.md b/docs/design/core/batch-manager/Design.md similarity index 88% rename from docs/design/core/batch-utilities/Design.md rename to docs/design/core/batch-manager/Design.md index 28bb6ba114b8..67f09159c8d6 100644 --- a/docs/design/core/batch-utilities/Design.md +++ b/docs/design/core/batch-manager/Design.md @@ -105,18 +105,16 @@ For each service that can leverage batch features, two classes will be created: public interface SqsBatchManager { /** - * Buffers a variable number of messages on the client and sends them - * as batch requests to the service. + * Buffers outgoing requests on the client and sends them as batch requests to the service. + * Requests are batched together according to a batchKey and are sent periodically to the + * service as determined by {@link #maxBatchOpenInMs}. If the number of requests for a + * batchKey reaches or exceeds {@link #maxBatchItems}, then the requests are immediately + * flushed and the timeout on the periodic flush is reset. + * By default, messages are batched according to a service's maximum size for a batch request. + * These settings can be customized via the configuration. * - * If the number of messages passed in is greater than the maximum size of - * a batch request, the method also automatically chunks the messages into - * the appropriate batch sizes before sending them with batch requests. - * By default, messages are chunked according to a service's maximum size for a - * batch request. These settings can be customized via the configuration. - * - * @param messages A variable number of SendMessageRequest items that represent - the messages to be passed to SQS. - * @return {@link BatchResponses} + * @param request the outgoing request. + * @return a CompletableFuture of the corresponding response. */ CompletableFuture sendMessage(SendMessageRequest message); @@ -126,7 +124,6 @@ For each service that can leverage batch features, two classes will be created: */ CompletableFuture flush(); - // Other Batch Manager methods omitted // ... @@ -170,20 +167,18 @@ For each service that can leverage batch features, two classes will be created: public interface SqsAsyncBatchManager { /** - * Buffers a variable number of messages on the client and sends them - * as batch requests to the service. + * Buffers outgoing requests on the client and sends them as batch requests to the service. + * Requests are batched together according to a batchKey and are sent periodically to the + * service as determined by {@link #maxBatchOpenInMs}. If the number of requests for a + * batchKey reaches or exceeds {@link #maxBatchItems}, then the requests are immediately + * flushed and the timeout on the periodic flush is reset. + * By default, messages are batched according to a service's maximum size for a batch request. + * These settings can be customized via the configuration. * - * If the number of messages passed in is greater than the maximum size of - * a batch request, the method also automatically chunks the messages into - * the appropriate batch sizes before sending them with batch requests. - * By default, messages are chunked according to a service's maximum size for a - * batch request. These settings can be customized via the configuration. - * - * @param messages A variable number of SendMessageRequest items that represent - the messages to be passed to SQS. - * @return {@link BatchResponses} + * @param request the outgoing request. + * @return a CompletableFuture of the corresponding response. */ - CompletableFuture sendMessage(SendMessageRequest messages); + CompletableFuture sendMessage(SendMessageRequest message); /** * Manually flush the buffer for sendMessage requests. Completes when requests @@ -191,14 +186,8 @@ For each service that can leverage batch features, two classes will be created: */ CompletableFuture flush(); - /** - * Option to flush a specific buffer/queue - * Buffer: DeleteMessage buffer, sendMessage buffer, ... - * Queue: User would provide queueUrl - * Note: The option to flush a specific buffer is not implemented in v1 nor - * has it been requested. - */ - CompletableFuture flush(String bufferOrQueueName); + // Other Batch Manager methods omitted + // ... interface Builder {