public class RangeShuffle extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RangeShuffle.KeyAndSizeExtractor<T>
KeyAndSizeExtractor is responsible for extracting the sort key and row size.
|
static class |
RangeShuffle.LocalSampleOperator<T>
LocalSampleOperator wraps the sample logic on the partition side (the first phase of
distributed sample algorithm).
|
Constructor and Description |
---|
RangeShuffle() |
Modifier and Type | Method and Description |
---|---|
static <T> org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.api.java.tuple.Tuple2<T,org.apache.flink.table.data.RowData>> |
rangeShuffleByKey(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.api.java.tuple.Tuple2<T,org.apache.flink.table.data.RowData>> inputDataStream,
SerializableSupplier<Comparator<T>> keyComparator,
org.apache.flink.api.common.typeinfo.TypeInformation<T> keyTypeInformation,
int localSampleSize,
int globalSampleSize,
int rangeNum,
int outParallelism,
RowType valueRowType,
boolean isSortBySize)
The RelNode with range-partition distribution will create the following transformations.
|
public static <T> org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.api.java.tuple.Tuple2<T,org.apache.flink.table.data.RowData>> rangeShuffleByKey(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.api.java.tuple.Tuple2<T,org.apache.flink.table.data.RowData>> inputDataStream, SerializableSupplier<Comparator<T>> keyComparator, org.apache.flink.api.common.typeinfo.TypeInformation<T> keyTypeInformation, int localSampleSize, int globalSampleSize, int rangeNum, int outParallelism, RowType valueRowType, boolean isSortBySize)
Explanation of the following figure: "[LSample, n]" means operator is LSample and parallelism is n, "LSample" means LocalSampleOperator, "GSample" means GlobalSampleOperator, "ARange" means AssignRangeId, "RRange" means RemoveRangeId.
[IN,n]->[LSample,n]->[GSample,1]-BROADCAST
\ \
-----------------------------BATCH-[ARange,n]-PARTITION->[RRange,m]->
The streams except the sample and histogram process stream will been blocked, so the the sample and histogram process stream does not care about requiredExchangeMode.
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.