You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/04/20 07:40:16 UTC
[GitHub] [spark] zhengruifeng commented on a diff in pull request #40827: [WIP][SPARK-42585][CONNECT] Streaming of local relations
zhengruifeng commented on code in PR #40827:
URL: https://github.com/apache/spark/pull/40827#discussion_r1172200683
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/artifact/SparkConnectArtifactManager.scala:
##########
@@ -91,7 +93,18 @@ class SparkConnectArtifactManager private[connect] {
remoteRelativePath: Path,
serverLocalStagingPath: Path): Unit = {
require(!remoteRelativePath.isAbsolute)
- if (remoteRelativePath.startsWith("classes/")) {
+ if (remoteRelativePath.startsWith("cache/")) {
+ val tmpFile = serverLocalStagingPath.toFile
+ Utils.tryWithSafeFinallyAndFailureCallbacks {
+ val updater = session.sparkContext.env.blockManager.TempFileBasedBlockStoreUpdater(
+ blockId = CacheId(remoteRelativePath.toString.stripPrefix("cache/")),
+ level = StorageLevel.MEMORY_AND_DISK,
+ classTag = implicitly[ClassTag[Object]],
+ tmpFile = tmpFile,
+ blockSize = tmpFile.length())
+ updater.save()
+ }(catchBlock = {tmpFile.delete()})
Review Comment:
will connect server remove the temp files after closing the connect session?
I guess we may add session id and user id to the blockId, and release all the related blocks when a session ends.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org