public class PartitioningUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PartitioningUtils.PartitionCounters
Counters used by mapreduce components when calculating hilbert values
|
Constructor and Description |
---|
PartitioningUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateNumReduceTasks(PartitioningResult partitioning)
Calculates how many reduce tasks are needed to process the partitions defined in a partitioning result file
|
static int |
calculateNumReduceTasks(Path partResPath, Configuration conf)
Calculates how many reduce tasks are needed to process the partitions defined in a partitioning result file
|
static java.util.Map<java.lang.String,java.lang.Integer> |
createPartitionsToReducersMap(PartitioningResult partitioning, int numReducers)
Maps partitions to reduce tasks so the reduce tasks contain approximately the same number of elements to process
|
static RTree |
indexPartitions(PartitioningResult pr, SpatialOperationConfig spatialOpConf, Configuration conf)
Takes a partitioning result and returns all contained partitions indexed in an r-tree
|
static PartitioningResult |
loadPartitioningResult(Path partResPath, Configuration conf)
Returns an object representation of a partitioning result file
|
static PartitioningResult |
loadPartitioningResultFromDistCache(Configuration conf)
Returns an object representation of a partitioning result file contained in the distributed cache.
|
public static int calculateNumReduceTasks(PartitioningResult partitioning)
partitioning
-public static int calculateNumReduceTasks(Path partResPath, Configuration conf) throws java.io.IOException
partResPath
-conf
-java.io.IOException
public static java.util.Map<java.lang.String,java.lang.Integer> createPartitionsToReducersMap(PartitioningResult partitioning, int numReducers)
partitioning
-numReducers
-public static RTree indexPartitions(PartitioningResult pr, SpatialOperationConfig spatialOpConf, Configuration conf) throws java.lang.Exception
pr
- partitioning resultspatialOpConf
- if provided, the indexed partitions geometries are optimized for the spatial operationconf
- a job's configurationjava.lang.Exception
public static PartitioningResult loadPartitioningResult(Path partResPath, Configuration conf) throws java.io.IOException
partResPath
-conf
-java.io.IOException
public static PartitioningResult loadPartitioningResultFromDistCache(Configuration conf) throws java.io.IOException
conf
-java.io.IOException
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.