Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-14243][CORE]update task metrics when removing blocks #12091

Closed
wants to merge 1 commit into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1264,9 +1264,12 @@ private[spark] class BlockManager(
"the disk, memory, or external block store")
}
blockInfoManager.removeBlock(blockId)
val removeBlockStatus = getCurrentBlockStatus(blockId, info)
if (tellMaster && info.tellMaster) {
val status = getCurrentBlockStatus(blockId, info)
reportBlockStatus(blockId, info, status)
reportBlockStatus(blockId, info, removeBlockStatus)
}
Option(TaskContext.get()).foreach { c =>
c.taskMetrics().incUpdatedBlockStatuses(Seq((blockId, removeBlockStatus)))
}
}
}
Expand Down
Expand Up @@ -928,6 +928,16 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE
assert(!store.diskStore.contains("list3"), "list3 was in disk store")
assert(!store.diskStore.contains("list4"), "list4 was in disk store")
assert(!store.diskStore.contains("list5"), "list5 was in disk store")

// remove block - list2 should be removed from disk
val updatedBlocks6 = getUpdatedBlocks {
store.removeBlock(
"list2", tellMaster = true)
}
assert(updatedBlocks6.size === 1)
assert(updatedBlocks6.head._1 === TestBlockId("list2"))
assert(updatedBlocks6.head._2.storageLevel == StorageLevel.NONE)
assert(!store.diskStore.contains("list2"), "list2 was in disk store")
}

test("query block statuses") {
Expand Down