Skip to content

Commit fa69571

Browse files
committed
Rename ConnectionPoolPartitioning into ChannelPoolPartitioning
1 parent 3574ecf commit fa69571

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

client/src/main/java/org/asynchttpclient/DefaultRequest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.List;
2727
import java.util.Map;
2828

29-
import org.asynchttpclient.channel.pool.ConnectionPoolPartitioning;
29+
import org.asynchttpclient.channel.pool.ChannelPoolPartitioning;
3030
import org.asynchttpclient.cookie.Cookie;
3131
import org.asynchttpclient.proxy.ProxyServer;
3232
import org.asynchttpclient.request.body.generator.BodyGenerator;
@@ -59,7 +59,7 @@ public class DefaultRequest implements Request {
5959
private final int requestTimeout;
6060
private final long rangeOffset;
6161
private final Charset charset;
62-
private final ConnectionPoolPartitioning connectionPoolPartitioning;
62+
private final ChannelPoolPartitioning channelPoolPartitioning;
6363
private final NameResolver nameResolver;
6464
// lazily loaded
6565
private List<Param> queryParams;
@@ -87,7 +87,7 @@ public DefaultRequest(String method,//
8787
int requestTimeout,//
8888
long rangeOffset,//
8989
Charset charset,//
90-
ConnectionPoolPartitioning connectionPoolPartitioning,//
90+
ChannelPoolPartitioning channelPoolPartitioning,//
9191
NameResolver nameResolver) {
9292
this.method = method;
9393
this.uri = uri;
@@ -112,7 +112,7 @@ public DefaultRequest(String method,//
112112
this.requestTimeout = requestTimeout;
113113
this.rangeOffset = rangeOffset;
114114
this.charset = charset;
115-
this.connectionPoolPartitioning = connectionPoolPartitioning;
115+
this.channelPoolPartitioning = channelPoolPartitioning;
116116
this.nameResolver = nameResolver;
117117
}
118118

@@ -237,8 +237,8 @@ public Charset getCharset() {
237237
}
238238

239239
@Override
240-
public ConnectionPoolPartitioning getConnectionPoolPartitioning() {
241-
return connectionPoolPartitioning;
240+
public ChannelPoolPartitioning getChannelPoolPartitioning() {
241+
return channelPoolPartitioning;
242242
}
243243

244244
@Override

client/src/main/java/org/asynchttpclient/Request.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.Collection;
2727
import java.util.List;
2828

29-
import org.asynchttpclient.channel.pool.ConnectionPoolPartitioning;
29+
import org.asynchttpclient.channel.pool.ChannelPoolPartitioning;
3030
import org.asynchttpclient.cookie.Cookie;
3131
import org.asynchttpclient.proxy.ProxyServer;
3232
import org.asynchttpclient.request.body.generator.BodyGenerator;
@@ -203,7 +203,7 @@ public interface Request {
203203
*/
204204
Charset getCharset();
205205

206-
ConnectionPoolPartitioning getConnectionPoolPartitioning();
206+
ChannelPoolPartitioning getChannelPoolPartitioning();
207207

208208
NameResolver getNameResolver();
209209
}

client/src/main/java/org/asynchttpclient/RequestBuilderBase.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.List;
3232
import java.util.Map;
3333

34-
import org.asynchttpclient.channel.pool.ConnectionPoolPartitioning;
34+
import org.asynchttpclient.channel.pool.ChannelPoolPartitioning;
3535
import org.asynchttpclient.cookie.Cookie;
3636
import org.asynchttpclient.proxy.ProxyServer;
3737
import org.asynchttpclient.request.body.generator.BodyGenerator;
@@ -85,7 +85,7 @@ public abstract class RequestBuilderBase<T extends RequestBuilderBase<T>> {
8585
protected int requestTimeout;
8686
protected long rangeOffset;
8787
protected Charset charset;
88-
protected ConnectionPoolPartitioning connectionPoolPartitioning = ConnectionPoolPartitioning.PerHostConnectionPoolPartitioning.INSTANCE;
88+
protected ChannelPoolPartitioning channelPoolPartitioning = ChannelPoolPartitioning.PerHostChannelPoolPartitioning.INSTANCE;
8989
protected NameResolver nameResolver = JdkNameResolver.INSTANCE;
9090

9191
protected RequestBuilderBase(String method, boolean disableUrlEncoding) {
@@ -134,7 +134,7 @@ protected RequestBuilderBase(Request prototype, boolean disableUrlEncoding, bool
134134
this.requestTimeout = prototype.getRequestTimeout();
135135
this.rangeOffset = prototype.getRangeOffset();
136136
this.charset = prototype.getCharset();
137-
this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning();
137+
this.channelPoolPartitioning = prototype.getChannelPoolPartitioning();
138138
this.nameResolver = prototype.getNameResolver();
139139
}
140140

@@ -421,8 +421,8 @@ public T setCharset(Charset charset) {
421421
return asDerivedType();
422422
}
423423

424-
public T setConnectionPoolPartitioning(ConnectionPoolPartitioning connectionPoolPartitioning) {
425-
this.connectionPoolPartitioning = connectionPoolPartitioning;
424+
public T setChannelPoolPartitioning(ChannelPoolPartitioning channelPoolPartitioning) {
425+
this.channelPoolPartitioning = channelPoolPartitioning;
426426
return asDerivedType();
427427
}
428428

@@ -476,7 +476,7 @@ private RequestBuilderBase<?> executeSignatureCalculator() {
476476
rb.requestTimeout = this.requestTimeout;
477477
rb.rangeOffset = this.rangeOffset;
478478
rb.charset = this.charset;
479-
rb.connectionPoolPartitioning = this.connectionPoolPartitioning;
479+
rb.channelPoolPartitioning = this.channelPoolPartitioning;
480480
rb.nameResolver = this.nameResolver;
481481
Request unsignedRequest = rb.build();
482482
signatureCalculator.calculateAndAddSignature(unsignedRequest, rb);
@@ -567,7 +567,7 @@ public Request build() {
567567
rb.requestTimeout,//
568568
rb.rangeOffset,//
569569
finalCharset,//
570-
rb.connectionPoolPartitioning,//
570+
rb.channelPoolPartitioning,//
571571
rb.nameResolver);
572572
}
573573
}

client/src/main/java/org/asynchttpclient/channel/pool/ConnectionPoolPartitioning.java renamed to client/src/main/java/org/asynchttpclient/channel/pool/ChannelPoolPartitioning.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.asynchttpclient.uri.Uri;
1717
import org.asynchttpclient.util.HttpUtils;
1818

19-
public interface ConnectionPoolPartitioning {
19+
public interface ChannelPoolPartitioning {
2020

2121
class ProxyPartitionKey {
2222
private final String proxyHost;
@@ -44,7 +44,7 @@ public String toString() {
4444

4545
Object getPartitionKey(Uri uri, String virtualHost, ProxyServer proxyServer);
4646

47-
enum PerHostConnectionPoolPartitioning implements ConnectionPoolPartitioning {
47+
enum PerHostChannelPoolPartitioning implements ChannelPoolPartitioning {
4848

4949
INSTANCE;
5050

client/src/main/java/org/asynchttpclient/netty/NettyResponseFuture.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.asynchttpclient.AsyncHandler;
3535
import org.asynchttpclient.Realm;
3636
import org.asynchttpclient.Request;
37-
import org.asynchttpclient.channel.pool.ConnectionPoolPartitioning;
37+
import org.asynchttpclient.channel.pool.ChannelPoolPartitioning;
3838
import org.asynchttpclient.future.AbstractListenableFuture;
3939
import org.asynchttpclient.netty.channel.ChannelState;
4040
import org.asynchttpclient.netty.channel.Channels;
@@ -55,7 +55,7 @@ public final class NettyResponseFuture<V> extends AbstractListenableFuture<V> {
5555
private static final Logger LOGGER = LoggerFactory.getLogger(NettyResponseFuture.class);
5656

5757
private final long start = millisTime();
58-
private final ConnectionPoolPartitioning connectionPoolPartitioning;
58+
private final ChannelPoolPartitioning connectionPoolPartitioning;
5959
private final ProxyServer proxyServer;
6060
private final int maxRetry;
6161
private final CountDownLatch latch = new CountDownLatch(1);
@@ -96,7 +96,7 @@ public NettyResponseFuture(Request originalRequest,//
9696
AsyncHandler<V> asyncHandler,//
9797
NettyRequest nettyRequest,//
9898
int maxRetry,//
99-
ConnectionPoolPartitioning connectionPoolPartitioning,//
99+
ChannelPoolPartitioning connectionPoolPartitioning,//
100100
ProxyServer proxyServer) {
101101

102102
this.asyncHandler = asyncHandler;
@@ -272,7 +272,7 @@ public Uri getUri() {
272272
return targetRequest.getUri();
273273
}
274274

275-
public ConnectionPoolPartitioning getConnectionPoolPartitioning() {
275+
public ChannelPoolPartitioning getConnectionPoolPartitioning() {
276276
return connectionPoolPartitioning;
277277
}
278278

client/src/main/java/org/asynchttpclient/netty/channel/ChannelManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import org.asynchttpclient.AsyncHandler;
5050
import org.asynchttpclient.AsyncHttpClientConfig;
5151
import org.asynchttpclient.SslEngineFactory;
52-
import org.asynchttpclient.channel.pool.ConnectionPoolPartitioning;
52+
import org.asynchttpclient.channel.pool.ChannelPoolPartitioning;
5353
import org.asynchttpclient.handler.AsyncHandlerExtensions;
5454
import org.asynchttpclient.netty.Callback;
5555
import org.asynchttpclient.netty.NettyResponseFuture;
@@ -287,7 +287,7 @@ public final void tryToOfferChannelToPool(Channel channel, AsyncHandler<?> async
287287
}
288288
}
289289

290-
public Channel poll(Uri uri, String virtualHost, ProxyServer proxy, ConnectionPoolPartitioning connectionPoolPartitioning) {
290+
public Channel poll(Uri uri, String virtualHost, ProxyServer proxy, ChannelPoolPartitioning connectionPoolPartitioning) {
291291
Object partitionKey = connectionPoolPartitioning.getPartitionKey(uri, virtualHost, proxy);
292292
return channelPool.poll(partitionKey);
293293
}

client/src/main/java/org/asynchttpclient/netty/handler/Protocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected boolean exitAfterHandlingRedirect(//
123123

124124
final RequestBuilder requestBuilder = new RequestBuilder(switchToGet ? GET : originalMethod)//
125125
.setCookies(request.getCookies())//
126-
.setConnectionPoolPartitioning(request.getConnectionPoolPartitioning())//
126+
.setChannelPoolPartitioning(request.getChannelPoolPartitioning())//
127127
.setFollowRedirect(true)//
128128
.setLocalAddress(request.getLocalAddress())//
129129
.setNameResolver(request.getNameResolver())//

client/src/main/java/org/asynchttpclient/netty/request/NettyRequestSender.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private <T> NettyResponseFuture<T> newNettyResponseFuture(Request request, Async
300300
asyncHandler,//
301301
nettyRequest,//
302302
config.getMaxRequestRetry(),//
303-
request.getConnectionPoolPartitioning(),//
303+
request.getChannelPoolPartitioning(),//
304304
proxyServer);
305305

306306
String expectHeader = request.getHeaders().get(HttpHeaders.Names.EXPECT);
@@ -468,7 +468,7 @@ private Channel pollPooledChannel(Request request, ProxyServer proxy, AsyncHandl
468468

469469
Uri uri = request.getUri();
470470
String virtualHost = request.getVirtualHost();
471-
final Channel channel = channelManager.poll(uri, virtualHost, proxy, request.getConnectionPoolPartitioning());
471+
final Channel channel = channelManager.poll(uri, virtualHost, proxy, request.getChannelPoolPartitioning());
472472

473473
if (channel != null) {
474474
LOGGER.debug("Using polled Channel {}\n for uri {}\n", channel, uri);

0 commit comments

Comments
 (0)