Skip to content

Commit 7ddd29a

Browse files
committed
Remove test and example. Leave it for the client.
1 parent 8aa41be commit 7ddd29a

5 files changed

Lines changed: 13 additions & 518 deletions

File tree

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequester.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ public class H2MultiplexingRequester extends AsyncRequester {
8989
private final H2ConnPool connPool;
9090

9191
/**
92-
* Hard cap on per-connection queued / in-flight requests.
92+
* Hard cap on per-connection queued / in-flight commands.
9393
* {@code <= 0} disables the cap.
9494
*/
95-
private final int maxRequestsPerConnection;
95+
private final int maxCommandsPerConnection;
9696

9797
/**
9898
* Use {@link H2MultiplexingRequesterBootstrap} to create instances of this class.
@@ -108,12 +108,12 @@ public H2MultiplexingRequester(
108108
final TlsStrategy tlsStrategy,
109109
final IOReactorMetricsListener threadPoolListener,
110110
final IOWorkerSelector workerSelector,
111-
final int maxRequestsPerConnection) {
111+
final int maxCommandsPerConnection) {
112112
super(eventHandlerFactory, ioReactorConfig, ioSessionDecorator, exceptionCallback, sessionListener,
113113
ShutdownCommand.GRACEFUL_IMMEDIATE_CALLBACK, DefaultAddressResolver.INSTANCE,
114114
threadPoolListener, workerSelector);
115115
this.connPool = new H2ConnPool(this, addressResolver, tlsStrategy);
116-
this.maxRequestsPerConnection = maxRequestsPerConnection;
116+
this.maxCommandsPerConnection = maxCommandsPerConnection;
117117
}
118118

119119
public void closeIdle(final TimeValue idleTime) {
@@ -254,12 +254,12 @@ public void failed(final Exception cause) {
254254
}
255255

256256
};
257-
final int max = maxRequestsPerConnection;
257+
final int max = maxCommandsPerConnection;
258258
if (max > 0) {
259259
final int current = ioSession.getPendingCommandCount();
260260
if (current >= 0 && current >= max) {
261261
exchangeHandler.failed(new RejectedExecutionException(
262-
"Maximum number of pending requests per connection reached (max=" + max + ")"));
262+
"Maximum number of pending commands per connection reached (max=" + max + ")"));
263263
exchangeHandler.releaseResources();
264264
return;
265265
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequesterBootstrap.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class H2MultiplexingRequesterBootstrap {
7777

7878
private IOReactorMetricsListener threadPoolListener;
7979

80-
private int maxRequestsPerConnection;
80+
private int maxCommandsPerConnection;
8181

8282
private H2MultiplexingRequesterBootstrap() {
8383
this.routeEntries = new ArrayList<>();
@@ -184,19 +184,19 @@ public final H2MultiplexingRequesterBootstrap setIOReactorMetricsListener(final
184184
}
185185

186186
/**
187-
* Sets a hard limit on the number of pending request execution commands that can be queued per connection.
187+
* Sets a hard limit on the number of pending commands execution commands that can be queued per connection.
188188
* When the limit is reached, new submissions fail fast with {@link java.util.concurrent.RejectedExecutionException}.
189189
* A value {@code <= 0} disables the limit (default).
190190
* Note: this limit applies to commands waiting in the connection's internal queue (backlog). HTTP/2 in-flight
191191
* concurrency is governed separately by protocol settings (e.g. MAX_CONCURRENT_STREAMS).
192192
*
193-
* @param max maximum number of pending requests per connection; {@code <= 0} to disable the limit.
193+
* @param max maximum number of pending commands per connection; {@code <= 0} to disable the limit.
194194
* @return this instance.
195195
* @since 5.5
196196
*/
197197
@Experimental
198-
public final H2MultiplexingRequesterBootstrap setMaxRequestsPerConnection(final int max) {
199-
this.maxRequestsPerConnection = max;
198+
public final H2MultiplexingRequesterBootstrap setMaxCommandsPerConnection(final int max) {
199+
this.maxCommandsPerConnection = max;
200200
return this;
201201
}
202202

@@ -295,7 +295,7 @@ public H2MultiplexingRequester create() {
295295
tlsStrategy != null ? tlsStrategy : new H2ClientTlsStrategy(),
296296
threadPoolListener,
297297
null,
298-
maxRequestsPerConnection);
298+
maxCommandsPerConnection);
299299
}
300300

301301
}

httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/H2MaxRequestsPerConnectionLocalExample.java

Lines changed: 0 additions & 245 deletions
This file was deleted.

httpcore5-h2/src/test/java/org/apache/hc/core5/http2/impl/nio/bootstrap/TestH2MultiplexingRequesterMaxRequestsPerConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void handle(
138138
final H2MultiplexingRequester requester = H2MultiplexingRequesterBootstrap.bootstrap()
139139
.setIOReactorConfig(ioReactorConfig)
140140
.setH2Config(H2Config.custom().setPushEnabled(false).build())
141-
.setMaxRequestsPerConnection(maxPerConn)
141+
.setMaxCommandsPerConnection(maxPerConn)
142142
.create();
143143

144144

0 commit comments

Comments
 (0)