This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new 49c6877 [SPARK-32024][WEBUI][FOLLOWUP] Quick fix on test failure on
missing when statements
49c6877 is described below
commit 49c6877a16f78d5ba8b2cad62dbccce3aa4198e6
Author: Jungtaek Lim (HeartSaVioR) <[email protected]>
AuthorDate: Thu Jul 9 15:26:38 2020 +0900
[SPARK-32024][WEBUI][FOLLOWUP] Quick fix on test failure on missing when
statements
### What changes were proposed in this pull request?
This patch fixes the test failure due to the missing when statements for
destination path. Note that it didn't fail on master branch, because 245aee9
got rid of size call in destination path, but still good to not depend on
245aee9.
### Why are the changes needed?
The build against branch-3.0 / branch-2.4 starts to fail after merging
SPARK-32024 (#28859) and this patch will fix it.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Ran modified UT against master / branch-3.0 / branch-2.4.
Closes #29046 from HeartSaVioR/QUICKFIX-SPARK-32024.
Authored-by: Jungtaek Lim (HeartSaVioR) <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit 161cf2a12698bfebba94e0d406e0b110e4429b6b)
Signed-off-by: HyukjinKwon <[email protected]>
---
.../org/apache/spark/deploy/history/HistoryServerDiskManager.scala | 2 +-
.../apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerDiskManager.scala
b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerDiskManager.scala
index dc17140..a1dc7ac 100644
---
a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerDiskManager.scala
+++
b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerDiskManager.scala
@@ -249,7 +249,7 @@ private class HistoryServerDiskManager(
}
}
- private def appStorePath(appId: String, attemptId: Option[String]): File = {
+ private[history] def appStorePath(appId: String, attemptId: Option[String]):
File = {
val fileName = appId + attemptId.map("_" + _).getOrElse("") + ".ldb"
new File(appStoreDir, fileName)
}
diff --git
a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala
b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala
index a050519..29a26d3 100644
---
a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala
+++
b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala
@@ -161,6 +161,8 @@ class HistoryServerDiskManagerSuite extends SparkFunSuite
with BeforeAndAfter {
val manager = mockManager()
val leaseA = manager.lease(2)
doReturn(3L).when(manager).sizeOf(meq(leaseA.tmpPath))
+ val dstPathA = manager.appStorePath("app1", None)
+ doReturn(3L).when(manager).sizeOf(meq(dstPathA))
val dstA = leaseA.commit("app1", None)
assert(manager.free() === 0)
assert(manager.committed() === 3)
@@ -181,6 +183,8 @@ class HistoryServerDiskManagerSuite extends SparkFunSuite
with BeforeAndAfter {
val leaseB = manager1.lease(2)
assert(manager1.free() === 1)
doReturn(2L).when(manager1).sizeOf(meq(leaseB.tmpPath))
+ val dstPathB = manager.appStorePath("app2", None)
+ doReturn(2L).when(manager1).sizeOf(meq(dstPathB))
val dstB = leaseB.commit("app2", None)
assert(manager1.committed() === 2)
// Listing store tracks dstB only, dstA is evicted by "makeRoom()".
@@ -196,6 +200,8 @@ class HistoryServerDiskManagerSuite extends SparkFunSuite
with BeforeAndAfter {
assert(manager2.free() === 0)
val leaseC = manager2.lease(2)
doReturn(2L).when(manager2).sizeOf(meq(leaseC.tmpPath))
+ val dstPathC = manager.appStorePath("app3", None)
+ doReturn(2L).when(manager2).sizeOf(meq(dstPathC))
val dstC = leaseC.commit("app3", None)
assert(manager2.free() === 1)
assert(manager2.committed() === 2)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]