HeartSaVioR commented on code in PR #36242:
URL: https://github.com/apache/spark/pull/36242#discussion_r852056800
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -168,6 +168,22 @@ class RocksDBSuite extends SparkFunSuite {
}
}
+ test("RocksDBFileManager: create init dfs directory with unknown number of
keys") {
+ val dfsRootDir = new File(Utils.createTempDir().getAbsolutePath +
"/state/1/1")
Review Comment:
Let's simply use `withTempDir` like below test.
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -168,6 +168,22 @@ class RocksDBSuite extends SparkFunSuite {
}
}
+ test("RocksDBFileManager: create init dfs directory with unknown number of
keys") {
+ val dfsRootDir = new File(Utils.createTempDir().getAbsolutePath +
"/state/1/1")
+ try {
+ val fileManager = new RocksDBFileManager(
+ dfsRootDir.getAbsolutePath, Utils.createTempDir(), new Configuration)
+ // Save a version of empty checkpoint files
+ val cpFiles = Seq()
+ assert(!dfsRootDir.exists())
+ saveCheckpointFiles(fileManager, cpFiles, version = 1, numKeys = -1)
Review Comment:
Could we verify the result with `loadAndVerifyCheckpointFiles(fileManager,
verificationDir, version = 1, Nil, -1)`?
--
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]