ToKeyGroup(Object key, int maxParallelism) { Preconditions.checkNotNull(key, "Assigned key must not be null!"); return computeKeyGroupForKeyHash(key.hashCode(), maxParallelism); } //2.使用murmurHash进行计算,并和最大并行度进行求余运算 public static int computeKeyGroupForKeyHash(int keyHash,...
key=keySelector.getKey(record.getInstance().getValue()); }catch(Exceptione) { thrownewRuntimeException( "Could not extract key from "+record.getInstance().getValue(),e); } returnKeyGroupRangeAssignment.assignKeyToParallelOperator( key,maxParallelism,numberOfChannels); } 1. 2. 3. 4. 5. ...
//key为分组键,maxParallelism由系统定义默认128,numberOfChannels为用户定义并行度 @Override publicintselectChannel(SerializationDelegate<StreamRecord<T>>record){ Kkey; try{ key=keySelector.getKey(record.getInstance().getValue()); }catch(Exceptione){ thrownewRuntimeException( "Couldnotextractkeyfrom"+...
key = keySelector.getKey(record.getInstance().getValue()); } catch (Exception e) { throw new RuntimeException("Could not extract key from " + record.getInstance().getValue(), e); } return KeyGroupRangeAssignment.assignKeyToParallelOperator(key, maxParallelism, numberOfChannels); } // Ke...
"Could not extract key from " + record.getInstance().getValue(),e);} return KeyGroupRangeAssignment.assignKeyToParallelOperator(key,maxParallelism,numberOfChannels);} public static int assignKeyToParallelOperator (Object key,int maxParallelism, int parallelism){ return computeOperatorIndexForKeyGroup(...
.partitionCustom()@OverridepublicintselectChannel(SerializationDelegate<StreamRecord<T>>record){Kkey;try{key=keySelector.getKey(record.getInstance().getValue());}catch(Exceptione){thrownewRuntimeException("Could not extract key from "+record.getInstance(),e);}returnpartitioner.partition(key,numberOf...
@OverridepublicintselectChannel(SerializationDelegate<StreamRecord<T>>record){K key;try{key=keySelector.getKey(record.getInstance().getValue());}catch(Exception e){thrownewRuntimeException("Could not extract key from "+record.getInstance().getValue(),e);}/** ...
* The types of the interface org.apache.flink.streaming.api.functions.source.SourceFunction could not be inferred. * Support for synthetic interfaces, lambdas, and generic or raw types is limited at this point * * * Created by xuwei.tech on 2018/10/23. ...
* Function to extract keys from the base stream * @param keyType * Defines the type of the extracted keys */ @Internal KeyedStream( DataStream<T> stream, PartitionTransformation<T> partitionTransformation, KeySelector<T, KEY> keySelector, ...
{Kkey;try{key=keySelector.getKey(record.getInstance().getValue());}catch(Exception e){thrownewRuntimeException("Could not extract key from "+record.getInstance().getValue(),e);}returnKeyGroupRangeAssignment.assignKeyToParallelOperator(key,maxParallelism,numberOfChannels);}@OverridepublicSubtask...