Remove unsafe type conversion from AbstractPartitioner.