Skip to content

Commit bc66ec5

Browse files
committed
modify the trait BlockDataManager.
1 parent 72cee6e commit bc66ec5

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

core/src/main/scala/org/apache/spark/network/BlockDataManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ trait BlockDataManager {
4646
/**
4747
* Release locks acquired by [[putBlockData()]] and [[getBlockData()]].
4848
*/
49-
def releaseLock(blockId: BlockId): Unit
49+
def releaseLock(blockId: BlockId, taskAttemptId: Option[Long]): Unit
5050
}

core/src/main/scala/org/apache/spark/storage/BlockManager.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,17 +717,13 @@ private[spark] class BlockManager(
717717
blockInfoManager.downgradeLock(blockId)
718718
}
719719

720-
/**
721-
* Release a lock on the given block.
722-
*/
723-
def releaseLock(blockId: BlockId): Unit = releaseLock(blockId, taskAttemptId = None)
724-
725720
/**
726721
* Release a lock on the given block with explicit TID.
727-
* This method should be used in case we can't get the correct TID from TaskContext, for example,
728-
* the input iterator of a cached RDD iterates to the end in a child thread.
722+
* The param `taskAttemptId` should be passed in case we can't get the correct TID from
723+
* TaskContext, for example, the input iterator of a cached RDD iterates to the end in a child
724+
* thread.
729725
*/
730-
def releaseLock(blockId: BlockId, taskAttemptId: Option[Long]): Unit = {
726+
def releaseLock(blockId: BlockId, taskAttemptId: Option[Long] = None): Unit = {
731727
blockInfoManager.unlock(blockId, taskAttemptId)
732728
}
733729

0 commit comments

Comments
 (0)