You can use `JavaPairRDD#values` to get the indices.