Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0.0
-
None
Description
private def getPartition(key: K): Int = { if (shouldPartition) partitioner.get.getPartition(key) else 0 }
The getPartition method checks shouldPartition every time it is called. However, shouldPartition should not be able to change after the ExternalSorter is instantiated. Therefore, it can be refactored to reduce the checks on shouldPartition.