bhattmanish98 commented on code in PR #7967:
URL: https://github.com/apache/hadoop/pull/7967#discussion_r2393620859
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsConnectionManager.java:
##########
@@ -91,26 +92,34 @@ class AbfsConnectionManager implements
HttpClientConnectionManager {
/**
* The base host for which connections are managed.
*/
- private HttpHost baseHost;
+ private final HttpHost baseHost;
AbfsConnectionManager(Registry<ConnectionSocketFactory>
socketFactoryRegistry,
- AbfsHttpClientConnectionFactory connectionFactory, KeepAliveCache kac,
- final AbfsConfiguration abfsConfiguration, final URL baseUrl) {
+ AbfsHttpClientConnectionFactory connectionFactory,
+ KeepAliveCache kac,
+ final AbfsConfiguration abfsConfiguration,
+ final URL baseUrl,
+ final boolean isCacheWarmupNeeded) {
this.httpConnectionFactory = connectionFactory;
this.kac = kac;
this.connectionOperator = new DefaultHttpClientConnectionOperator(
socketFactoryRegistry, null, null);
this.abfsConfiguration = abfsConfiguration;
- if (abfsConfiguration.getApacheCacheWarmupCount() > 0
+ this.baseHost = new HttpHost(baseUrl.getHost(),
+ baseUrl.getDefaultPort(), baseUrl.getProtocol());
+ if (isCacheWarmupNeeded && abfsConfiguration.getApacheCacheWarmupCount() > 0
&& kac.getFixedThreadPool() != null) {
// Warm up the cache with connections.
LOG.debug("Warming up the KeepAliveCache with {} connections",
abfsConfiguration.getApacheCacheWarmupCount());
- this.baseHost = new HttpHost(baseUrl.getHost(),
- baseUrl.getDefaultPort(), baseUrl.getProtocol());
HttpRoute route = new HttpRoute(baseHost, null, true);
- cacheExtraConnection(route,
+ int totalConnectionsCreated = cacheExtraConnection(route,
abfsConfiguration.getApacheCacheWarmupCount());
+ if (totalConnectionsCreated == 0) {
Review Comment:
Yes, make sense. I have updated the returned value in case of rejected
exception; other thing will remain the same.
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClientHandler.java:
##########
@@ -68,13 +68,13 @@ public AbfsClientHandler(final URL baseUrl,
final SASTokenProvider sasTokenProvider,
final EncryptionContextProvider encryptionContextProvider,
final AbfsClientContext abfsClientContext) throws IOException {
+ initServiceType(abfsConfiguration);
Review Comment:
This will initialize the default and ingress service types. This is needed
before crating the clients so that we can do cache warmup only for default
client.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]