Class GlobalProperties
- java.lang.Object
-
- org.apache.flink.optimizer.dataproperties.GlobalProperties
-
- All Implemented Interfaces:
Cloneable
public class GlobalProperties extends Object implements Cloneable
This class represents global properties of the data at a certain point in the plan. Global properties are properties that describe data across different partitions, such as whether the data is hash partitioned, range partitioned, replicated, etc.
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description GlobalProperties()Initializes the global properties with no partitioning.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUniqueFieldCombination(org.apache.flink.api.common.operators.util.FieldSet fields)voidclearUniqueFieldCombinations()GlobalPropertiesclone()static GlobalPropertiescombine(GlobalProperties gp1, GlobalProperties gp2)booleanequals(Object obj)GlobalPropertiesfilterBySemanticProperties(org.apache.flink.api.common.operators.SemanticProperties props, int input)Filters these GlobalProperties by the fields that are forwarded to the output as described by the SemanticProperties.org.apache.flink.api.common.functions.Partitioner<?>getCustomPartitioner()org.apache.flink.api.common.distributions.DataDistributiongetDataDistribution()PartitioningPropertygetPartitioning()org.apache.flink.api.common.operators.util.FieldListgetPartitioningFields()org.apache.flink.api.common.operators.OrderinggetPartitioningOrdering()Set<org.apache.flink.api.common.operators.util.FieldSet>getUniqueFieldCombination()inthashCode()booleanisExactlyPartitionedOnFields(org.apache.flink.api.common.operators.util.FieldList fields)booleanisFullyReplicated()booleanisPartitionedOnFields(org.apache.flink.api.common.operators.util.FieldSet fields)booleanisTrivial()Checks, if the properties in this object are trivial, i.e.booleanmatchesOrderedPartitioning(org.apache.flink.api.common.operators.Ordering o)voidparameterizeChannel(Channel channel, boolean globalDopChange, org.apache.flink.api.common.ExecutionMode exchangeMode, boolean breakPipeline)voidreset()This method resets the properties to a state where no properties are given.voidsetAnyPartitioning(org.apache.flink.api.common.operators.util.FieldList partitionedFields)voidsetCustomPartitioned(org.apache.flink.api.common.operators.util.FieldList partitionedFields, org.apache.flink.api.common.functions.Partitioner<?> partitioner)voidsetForcedRebalanced()voidsetFullyReplicated()voidsetHashPartitioned(org.apache.flink.api.common.operators.util.FieldList partitionedFields)Sets this global properties to represent a hash partitioning.voidsetRandomPartitioned()voidsetRangePartitioned(org.apache.flink.api.common.operators.Ordering ordering)Set the parameters for range partition.voidsetRangePartitioned(org.apache.flink.api.common.operators.Ordering ordering, org.apache.flink.api.common.distributions.DataDistribution distribution)Set the parameters for range partition.StringtoString()
-
-
-
Method Detail
-
setHashPartitioned
public void setHashPartitioned(org.apache.flink.api.common.operators.util.FieldList partitionedFields)
Sets this global properties to represent a hash partitioning.- Parameters:
partitionedFields- The key fields on which the data is hash partitioned.
-
setRangePartitioned
public void setRangePartitioned(org.apache.flink.api.common.operators.Ordering ordering)
Set the parameters for range partition.- Parameters:
ordering- Order of the partitioned fields
-
setRangePartitioned
public void setRangePartitioned(org.apache.flink.api.common.operators.Ordering ordering, org.apache.flink.api.common.distributions.DataDistribution distribution)Set the parameters for range partition.- Parameters:
ordering- Order of the partitioned fieldsdistribution- The data distribution for range partition. User can supply a customized data distribution, also the data distribution can be null.
-
setAnyPartitioning
public void setAnyPartitioning(org.apache.flink.api.common.operators.util.FieldList partitionedFields)
-
setRandomPartitioned
public void setRandomPartitioned()
-
setFullyReplicated
public void setFullyReplicated()
-
setForcedRebalanced
public void setForcedRebalanced()
-
setCustomPartitioned
public void setCustomPartitioned(org.apache.flink.api.common.operators.util.FieldList partitionedFields, org.apache.flink.api.common.functions.Partitioner<?> partitioner)
-
addUniqueFieldCombination
public void addUniqueFieldCombination(org.apache.flink.api.common.operators.util.FieldSet fields)
-
clearUniqueFieldCombinations
public void clearUniqueFieldCombinations()
-
getUniqueFieldCombination
public Set<org.apache.flink.api.common.operators.util.FieldSet> getUniqueFieldCombination()
-
getPartitioningFields
public org.apache.flink.api.common.operators.util.FieldList getPartitioningFields()
-
getPartitioningOrdering
public org.apache.flink.api.common.operators.Ordering getPartitioningOrdering()
-
getPartitioning
public PartitioningProperty getPartitioning()
-
getCustomPartitioner
public org.apache.flink.api.common.functions.Partitioner<?> getCustomPartitioner()
-
getDataDistribution
public org.apache.flink.api.common.distributions.DataDistribution getDataDistribution()
-
isPartitionedOnFields
public boolean isPartitionedOnFields(org.apache.flink.api.common.operators.util.FieldSet fields)
-
isExactlyPartitionedOnFields
public boolean isExactlyPartitionedOnFields(org.apache.flink.api.common.operators.util.FieldList fields)
-
matchesOrderedPartitioning
public boolean matchesOrderedPartitioning(org.apache.flink.api.common.operators.Ordering o)
-
isFullyReplicated
public boolean isFullyReplicated()
-
isTrivial
public boolean isTrivial()
Checks, if the properties in this object are trivial, i.e. only standard values.
-
reset
public void reset()
This method resets the properties to a state where no properties are given.
-
filterBySemanticProperties
public GlobalProperties filterBySemanticProperties(org.apache.flink.api.common.operators.SemanticProperties props, int input)
Filters these GlobalProperties by the fields that are forwarded to the output as described by the SemanticProperties.- Parameters:
props- The semantic properties holding information about forwarded fields.input- The index of the input.- Returns:
- The filtered GlobalProperties
-
parameterizeChannel
public void parameterizeChannel(Channel channel, boolean globalDopChange, org.apache.flink.api.common.ExecutionMode exchangeMode, boolean breakPipeline)
-
clone
public GlobalProperties clone()
-
combine
public static GlobalProperties combine(GlobalProperties gp1, GlobalProperties gp2)
-
-