skonto commented on a change in pull request #23546: [SPARK-23153][K8s] Support
client dependencies with a Hadoop Compatible File System
URL: https://github.com/apache/spark/pull/23546#discussion_r253473803
##########
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:
will do thanx.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]