srowen commented on a change in pull request #23546: [SPARK-23153][K8s] Support 
client dependencies with a HCFS
URL: https://github.com/apache/spark/pull/23546#discussion_r247913882
 
 

 ##########
 File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala
 ##########
 @@ -71,17 +75,64 @@ private[spark] object KubernetesUtils extends Logging {
    * - File URIs with scheme local:// resolve to just the path of the URI.
    * - Otherwise, the URIs are returned as-is.
    */
-  def resolveFileUrisAndPath(fileUris: Iterable[String]): Iterable[String] = {
+  def resolveFileUrisAndPath(fileUris: Iterable[String], conf: 
Option[SparkConf] = None)
+  : Iterable[String] = {
     fileUris.map { uri =>
-      resolveFileUri(uri)
+      resolveFileUri(uri, conf)
     }
   }
 
-  def resolveFileUri(uri: String): String = {
+  /**
+   * Get the final path for a client file, if not return the uri as is.
+   *
+   */
+  def getDestPathIfClientFile(uri: String, conf: SparkConf): String = {
+    val fileUri = Utils.resolveURI(uri)
+    val fileScheme = Option(fileUri.getScheme).getOrElse("file")
+    if (fileScheme == "client") {
+      if (conf.get(KUBERNETES_FILE_UPLOAD_PATH).isDefined) {
 
 Review comment:
   Likewise matching could save a little repetition here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to