0

好的,所以我pointsList<GeoPoint>

以下代码是使用 java 8 功能 API 编写的。它获取点,为每个点计算其匹配的集群 ,然后将它们按点分组ClusterKey。最终我们得到一个Map<ClusterKey, List<GeoPoint>Here it is:

points.
   parallelStream().unordered().
   collect(groupingByConcurrent(Functions::calcClusterKey))
4

1 回答 1

2
sc.parallelize(points).groupBy(Functions.calcClusterKey).collect.toMap

对应是相当1:1。

于 2015-01-28T16:02:01.053 回答