Skip to content

[SPARK-39680][CORE] Remove hasSpaceForAnotherRecord from UnsafeExternalSorter #37086

Closed
LuciferYang wants to merge 1 commit intoapache:masterfrom
LuciferYang:unused-VisibleForTesting
Closed

[SPARK-39680][CORE] Remove hasSpaceForAnotherRecord from UnsafeExternalSorter #37086
LuciferYang wants to merge 1 commit intoapache:masterfrom
LuciferYang:unused-VisibleForTesting

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Jul 5, 2022

What changes were proposed in this pull request?

This pr just remove an unused @VisibleForTesting method from UnsafeExternalSorter .

Why are the changes needed?

Code clean.

SPARK-21907 introduce hasSpaceForAnotherRecord() method for UnsafeExternalSorter, it is identified as @VisibleForTesting and only used by UnsafeExternalSorterSuite#testOOMDuringSpill.

After SPARK-32901, testOOMDuringSpill in UnsafeExternalSorterSuite rename to testNoOOMDuringSpill and hasSpaceForAnotherRecord() method is no longer used in current master now.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass GitHub Actions.

@github-actions github-actions bot added the CORE label Jul 5, 2022
}
}

@VisibleForTesting boolean hasSpaceForAnotherRecord() {
Copy link
Member

@dongjoon-hyun dongjoon-hyun Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making a PR, but I'd not remove this. Although this is not used currently, this was added once inevitably. I feel this removal might become a too hasty decision because UnsafeExternalSorter is designed to be based on UnsafeInMemorySorter and UnsafeInMemorySorter.hasSpaceForAnotherRecord() is a useful public method. It still looks okay to me to have this VisibleForTesting method to expose the underlying structure.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask if you are currently some other refactoring on this area? I'm wondering if you want to encapsulate back for some reasons or not.

@LuciferYang
Copy link
Contributor Author

May I ask if you are currently some other refactoring on this area? I'm wondering if you want to encapsulate back for some reasons or not.

Not yet, just see this method is no longer used. I will close this pr

@LuciferYang
Copy link
Contributor Author

thanks for your review @dongjoon-hyun

@LuciferYang LuciferYang closed this Jul 6, 2022
@dongjoon-hyun
Copy link
Member

Thank you for closing and sorry for your loss of this PR. If we want to remove this, we can reuse this JIRA and PR.

@LuciferYang
Copy link
Contributor Author

Thank you for closing and sorry for your loss of this PR. If we want to remove this, we can reuse this JIRA and PR.

OK ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants