public final class KeyDrivenDataDistribution extends PartialStaticDataDistribution
function of input
. This
guarantees that data with rows with equivalent keys are located in the same partition.Modifier and Type | Method and Description |
---|---|
AliasSet[] |
getAliases()
Returns the fields that are referenced by this distribution.
|
PartitioningFunction |
getBasePartitionFunction()
Returns the base partitioning function.
|
String[] |
getKeys()
Returns the keys by which we are partitioned.
|
protected PartitioningFunction |
getPartitioningFunction()
Subclasses must override this method to provide the partitioning function to be used
|
static KeyDrivenDataDistribution |
hashed(List<String> keys)
Returns a distribution that distributes based on a hashcode of
the named key fields.
|
static KeyDrivenDataDistribution |
hashed(String... keys)
Returns a distribution that distributes based on a hashcode of
the named key fields.
|
boolean |
isGroupedBy(String[] keys)
Returns true if this distribution guarantees groupings on the specified list
of keys will not be split across partitions.
|
boolean |
isGroupingCompatible(String[] keys)
Returns true if this distribution guarantees groupings on the specified list
of keys will not be split across partitions.
|
boolean |
isLocal() |
static KeyDrivenDataDistribution |
keyed(PartitioningFunction basePartitionFunction,
List<String> keys)
Returns a distribution that distributes based on the given function
of the named key fields.
|
static KeyDrivenDataDistribution |
keyed(PartitioningFunction basePartitionFunction,
String... keys)
Returns a distribution that distributes based on the given function
of the named key fields.
|
static KeyDrivenDataDistribution |
localKeyed(PartitioningFunction basePartitionFunction,
List<String> keys)
For advanced use only; this redistributes per-JVM but not across the cluster.
|
static KeyDrivenDataDistribution |
ranges(List<RecordToken> boundaries)
Returns a distribution that distributes based on specified range boundaries
|
PartialDataDistribution |
remap(FieldRemapping mapping)
Applies the given field remapping to this distribution, changing names as required.
|
protected boolean |
requiresRepartitionFrom(PartialDataDistribution source)
Subclasses must override this method to declare whether a repartition is required given the source
distribution.
|
protected boolean |
supportsLocalRepartition()
Subclasses may override to indicate that they support a local repartition
|
String |
toString() |
getGatherScheme
public static KeyDrivenDataDistribution hashed(String... keys)
keys
- the names of the key fieldspublic static KeyDrivenDataDistribution hashed(List<String> keys)
keys
- the names of the key fieldspublic static KeyDrivenDataDistribution ranges(List<RecordToken> boundaries)
boundaries
- the range boundariespublic static KeyDrivenDataDistribution keyed(PartitioningFunction basePartitionFunction, String... keys)
basePartitionFunction
- the partition functionkeys
- the names of the key fieldsIllegalArgumentException
- if the provided function is not a function of input
public static KeyDrivenDataDistribution keyed(PartitioningFunction basePartitionFunction, List<String> keys) throws IllegalArgumentException
basePartitionFunction
- the partition functionkeys
- the names of the key fieldsIllegalArgumentException
- if the provided function is not a function of input
public static KeyDrivenDataDistribution localKeyed(PartitioningFunction basePartitionFunction, List<String> keys) throws IllegalArgumentException
basePartitionFunction
- the partition functionkeys
- the names of the key fieldsIllegalArgumentException
- if the provided function is not a function of input
public PartitioningFunction getBasePartitionFunction()
public boolean isLocal()
public boolean isGroupedBy(String[] keys)
keys
- the group keyspublic boolean isGroupingCompatible(String[] keys)
keys
- the group keysprotected boolean requiresRepartitionFrom(PartialDataDistribution source)
PartialStaticDataDistribution
requiresRepartitionFrom
in class PartialStaticDataDistribution
source
- the source distributionpublic String toString()
toString
in class DataDistribution
public String[] getKeys()
public PartialDataDistribution remap(FieldRemapping mapping)
UnspecifiedPartialDistribution
.remap
in class DataDistribution
mapping
- the field remapping.public AliasSet[] getAliases()
DataDistribution
getAliases
in class DataDistribution
protected PartitioningFunction getPartitioningFunction()
PartialStaticDataDistribution
getPartitioningFunction
in class PartialStaticDataDistribution
protected boolean supportsLocalRepartition()
PartialStaticDataDistribution
supportsLocalRepartition
in class PartialStaticDataDistribution
Copyright © 2020 Actian Corporation. All rights reserved.