skonto 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_r249686994
########## 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) { + val uploadPath = conf.get(KUBERNETES_FILE_UPLOAD_PATH).get + s"${uploadPath}/${fileUri.getPath.split("/").last}" Review comment: I am currently not supporting that. I thought of that. People should make sure they dont create a conflict. Otherwise I will have to create random paths. ---------------------------------------------------------------- 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