Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()".
Expand All @@ -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)
Expand Down