ResponseOutOfOrderStrategy implementation which checks for premature responses every chunkSize
bytes. An 8 KiB chunk size is used by default based on testing using values between 4 KiB and 128 KiB. This is
optimized for correctness and results in a maximum upload speed of 8 MiB/s until maxChunksToCheck is
reached.
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private static final int | |
| public static final MonitoringResponseOutOfOrderStrategy | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MonitoringResponseOutOfOrderStrategy(final long
The chunk size after which a response check is executed. chunkSize)Instantiates a |
| public | MonitoringResponseOutOfOrderStrategy(final long
The chunk size after which a response check is executed. chunkSize, final long The maximum number of chunks to check, allowing expensive checks to be avoided
after a sufficient portion of the request entity has been transferred. maxChunksToCheck)Instantiates a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isEarlyResponseDetected(final ClassicHttpRequest
The current request. request, final HttpClientConnection The connection used to send the current request. connection, final InputStream The response stream, this may be used to check for an early response. inputStream, final long Number of bytes that have already been sent. totalBytesSent, final long The size of a socket write operation that will follow this check. nextWriteSize)Implements org. java. with the number of
bytes that have already been sent, and the size of the write that will occur if this check
does not encounter an out of order response.
|
| private boolean | |
| public String |
| chunkSize | back to summary |
|---|---|
| private final long chunkSize | |
| DEFAULT_CHUNK_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_CHUNK_SIZE | |
| INSTANCE | back to summary |
|---|---|
| public static final MonitoringResponseOutOfOrderStrategy INSTANCE | |
| maxChunksToCheck | back to summary |
|---|---|
| private final long maxChunksToCheck | |
| MonitoringResponseOutOfOrderStrategy | back to summary |
|---|---|
| public MonitoringResponseOutOfOrderStrategy() Instantiates a default | |
| MonitoringResponseOutOfOrderStrategy | back to summary |
|---|---|
| public MonitoringResponseOutOfOrderStrategy(final long chunkSize) Instantiates a
| |
| MonitoringResponseOutOfOrderStrategy | back to summary |
|---|---|
| public MonitoringResponseOutOfOrderStrategy(final long chunkSize, final long maxChunksToCheck) Instantiates a
| |
| isEarlyResponseDetected | back to summary |
|---|---|
| public boolean isEarlyResponseDetected(final ClassicHttpRequest request, final HttpClientConnection connection, final InputStream inputStream, final long totalBytesSent, final long nextWriteSize) throws IOException Implements org. Doc from org. Called before each write to the to a socket
| |
| nextWriteStartsNewChunk | back to summary |
|---|---|
| private boolean nextWriteStartsNewChunk(final long totalBytesSent, final long nextWriteSize) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |