private class SendQueueBuffer.SendMessageBatchTask extends SendQueueBuffer.OutboundBatchTask<SendMessageRequest,SendMessageResult>
Modifier and Type | Field and Description |
---|---|
(package private) int |
batchSizeBytes |
futures, requests
Modifier | Constructor and Description |
---|---|
private |
SendMessageBatchTask() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isFull()
Checks whether the buffer is now full.
|
protected boolean |
isOkToAdd(SendMessageRequest request)
Checks whether it's okay to add the request to this buffer.
|
protected void |
onRequestAdded(SendMessageRequest request)
A hook to be run when a request is successfully added to this buffer.
|
protected void |
process(java.util.List<SendMessageRequest> requests,
java.util.List<QueueBufferFuture<SendMessageRequest,SendMessageResult>> futures)
Processes the batch once closed.
|
addRequest, run, setOnCompleted
protected boolean isOkToAdd(SendMessageRequest request)
SendQueueBuffer.OutboundBatchTask
addIfAllowed
with a lock on this
held.isOkToAdd
in class SendQueueBuffer.OutboundBatchTask<SendMessageRequest,SendMessageResult>
request
- the request to addprotected void onRequestAdded(SendMessageRequest request)
SendQueueBuffer.OutboundBatchTask
addIfAllowed
with a lock on this
held.onRequestAdded
in class SendQueueBuffer.OutboundBatchTask<SendMessageRequest,SendMessageResult>
request
- the request that was addedprotected boolean isFull()
SendQueueBuffer.OutboundBatchTask
addIfAllowed
with a lock on
this
held.isFull
in class SendQueueBuffer.OutboundBatchTask<SendMessageRequest,SendMessageResult>
protected void process(java.util.List<SendMessageRequest> requests, java.util.List<QueueBufferFuture<SendMessageRequest,SendMessageResult>> futures)
SendQueueBuffer.OutboundBatchTask
this
.
However, it's passed a local copy of both the requests
and futures
lists
made while holding the lock.process
in class SendQueueBuffer.OutboundBatchTask<SendMessageRequest,SendMessageResult>