本文整理了Java中org.apache.spark.api.java.JavaPairRDD.partitionBy()
方法的一些代码示例,展示了JavaPairRDD.partitionBy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JavaPairRDD.partitionBy()
方法的具体详情如下:
包路径:org.apache.spark.api.java.JavaPairRDD
类名称:JavaPairRDD
方法名:partitionBy
暂无
代码示例来源:origin: apache/tinkerpop
final Partitioner partitioner = new HashPartitioner(this.workersSet ? this.workers : loadedGraphRDD.partitions().size());
this.logger.debug("Partitioning the loaded graphRDD: " + partitioner);
loadedGraphRDD = loadedGraphRDD.partitionBy(partitioner);
partitioned = true;
assert loadedGraphRDD.partitioner().isPresent();
代码示例来源:origin: uber/hudi
private JavaRDD<HoodieRecord<T>> partition(JavaRDD<HoodieRecord<T>> dedupedRecords,
Partitioner partitioner) {
return dedupedRecords.mapToPair(record -> new Tuple2<>(
new Tuple2<>(record.getKey(), Option.apply(record.getCurrentLocation())), record))
.partitionBy(partitioner).map(Tuple2::_2);
}
代码示例来源:origin: DataSystemsLab/GeoSpark
/**
* Spatial partitioning without duplicates.
*
* @return true, if successful
* @throws Exception the exception
*/
private boolean spatialPartitioningWithoutDuplicates()
throws Exception
{
this.distributedRasterColorMatrix = this.distributedRasterColorMatrix.mapToPair(new PairFunction<Tuple2<Pixel, Integer>, Pixel, Integer>()
{
@Override
public Tuple2<Pixel, Integer> call(Tuple2<Pixel, Integer> pixelDoubleTuple2)
throws Exception
{
Pixel newPixel = new Pixel(pixelDoubleTuple2._1().getX(), pixelDoubleTuple2._1().getY(), resolutionX, resolutionY);
newPixel.setDuplicate(false);
newPixel.setCurrentPartitionId(VisualizationPartitioner.CalculatePartitionId(resolutionX, resolutionY, partitionX, partitionY, pixelDoubleTuple2._1.getX(), pixelDoubleTuple2._1.getY()));
Tuple2<Pixel, Integer> newPixelDoubleTuple2 = new Tuple2<Pixel, Integer>(newPixel, pixelDoubleTuple2._2());
return newPixelDoubleTuple2;
}
});
this.distributedRasterColorMatrix = this.distributedRasterColorMatrix.partitionBy(new VisualizationPartitioner(this.resolutionX, this.resolutionY, this.partitionX, this.partitionY));
return true;
}
代码示例来源:origin: com.uber.hoodie/hoodie-client
private JavaRDD<HoodieRecord<T>> partition(JavaRDD<HoodieRecord<T>> dedupedRecords,
Partitioner partitioner) {
return dedupedRecords.mapToPair(record -> new Tuple2<>(
new Tuple2<>(record.getKey(), Option.apply(record.getCurrentLocation())), record))
.partitionBy(partitioner).map(tuple -> tuple._2());
}
代码示例来源:origin: org.datasyslab/geospark
).partitionBy(partitioner)
.mapPartitions(new FlatMapFunction<Iterator<Tuple2<Integer, T>>, T>()
代码示例来源:origin: DataSystemsLab/GeoSpark
).partitionBy(partitioner)
.mapPartitions(new FlatMapFunction<Iterator<Tuple2<Integer, T>>, T>()
代码示例来源:origin: DataSystemsLab/GeoSpark
/**
* Spatial partitioning with duplicates.
*
* @return true, if successful
* @throws Exception the exception
*/
private boolean spatialPartitioningWithDuplicates()
throws Exception
{
this.distributedRasterCountMatrix = this.distributedRasterCountMatrix.flatMapToPair(new PairFlatMapFunction<Tuple2<Pixel, Double>, Pixel, Double>()
{
@Override
public Iterator<Tuple2<Pixel, Double>> call(Tuple2<Pixel, Double> pixelDoubleTuple2)
throws Exception
{
VisualizationPartitioner vizPartitioner = new VisualizationPartitioner(resolutionX, resolutionY, partitionX, partitionY);
return vizPartitioner.assignPartitionIDs(pixelDoubleTuple2, photoFilterRadius).iterator();
}
});
this.distributedRasterCountMatrix = this.distributedRasterCountMatrix.partitionBy(new VisualizationPartitioner(this.resolutionX, this.resolutionY, this.partitionX, this.partitionY));
return true;
}
代码示例来源:origin: uber/marmaray
).partitionBy(
new Partitioner() {
@Override
代码示例来源:origin: ai.grakn/grakn-kb
this.workers : loadedGraphRDD.partitions().size());
this.logger.debug("Partitioning the loaded graphRDD: " + partitioner);
loadedGraphRDD = loadedGraphRDD.partitionBy(partitioner);
partitioned = true;
assert loadedGraphRDD.partitioner().isPresent();
代码示例来源:origin: locationtech/geowave
}).partitionBy(partitioner).persist(StorageLevel.MEMORY_AND_DISK_SER());
代码示例来源:origin: org.apache.tinkerpop/spark-gremlin
final Partitioner partitioner = new HashPartitioner(this.workersSet ? this.workers : loadedGraphRDD.partitions().size());
this.logger.debug("Partitioning the loaded graphRDD: " + partitioner);
loadedGraphRDD = loadedGraphRDD.partitionBy(partitioner);
partitioned = true;
assert loadedGraphRDD.partitioner().isPresent();
内容来源于网络,如有侵权,请联系作者删除!