pan3793 commented on code in PR #48446:
URL: https://github.com/apache/spark/pull/48446#discussion_r1802394173


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/SparkKubernetesClientFactory.scala:
##########
@@ -103,42 +100,43 @@ object SparkKubernetesClientFactory extends Logging {
       .withRequestTimeout(clientType.requestTimeout(sparkConf))
       .withConnectionTimeout(clientType.connectionTimeout(sparkConf))
       .withTrustCerts(sparkConf.get(KUBERNETES_TRUST_CERTIFICATES))
-      .withOption(oauthTokenValue) {
-        (token, configBuilder) => configBuilder.withOauthToken(token)
-      }.withOption(oauthTokenFile) {
-        (file, configBuilder) =>
-            configBuilder.withOauthToken(Files.asCharSource(file, 
Charsets.UTF_8).read())
-      }.withOption(caCertFile) {
-        (file, configBuilder) => configBuilder.withCaCertFile(file)
-      }.withOption(clientKeyFile) {
-        (file, configBuilder) => configBuilder.withClientKeyFile(file)
-      }.withOption(clientCertFile) {
-        (file, configBuilder) => configBuilder.withClientCertFile(file)
-      }.withOption(namespace) {
-        (ns, configBuilder) => configBuilder.withNamespace(ns)
-      }.build()
-    val factoryWithCustomDispatcher = new OkHttpClientFactory() {
-      override protected def additionalConfig(builder: OkHttpClient.Builder): 
Unit = {
-        builder.dispatcher(dispatcher)
+      .withOption(oauthTokenValue) { (token, configBuilder) =>
+        configBuilder.withOauthToken(token)
       }
-    }
-    logDebug("Kubernetes client config: " +
-      new 
ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(config))
+      .withOption(oauthTokenFile) { (file, configBuilder) =>
+        configBuilder.withOauthToken(Files.asCharSource(file, 
Charsets.UTF_8).read())
+      }
+      .withOption(caCertFile) { (file, configBuilder) =>
+        configBuilder.withCaCertFile(file)
+      }
+      .withOption(clientKeyFile) { (file, configBuilder) =>
+        configBuilder.withClientKeyFile(file)
+      }
+      .withOption(clientCertFile) { (file, configBuilder) =>
+        configBuilder.withClientCertFile(file)
+      }
+      .withOption(namespace) { (ns, configBuilder) =>
+        configBuilder.withNamespace(ns)
+      }
+      .build()
+    logDebug(
+      "Kubernetes client config: " +
+        new 
ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(config))
     new KubernetesClientBuilder()
-      .withHttpClientFactory(factoryWithCustomDispatcher)

Review Comment:
   then how do you choose the exact one you want to use if there are multi 
impls under the classpath?



-- 
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]

Reply via email to