public static KeyGroupRange computeKeyGroupRangeForOperatorIndex ( int maxParallelism , int parallelism , int operatorIndex ) { checkParallelismPreconditions ( parallelism ) ; checkParallelismPreconditions ( maxParallelism ) ; Preconditions . checkArgument ( maxParallelism >= parallelism , "Maximum parallelism must not be smaller than parallelism." ) ; int start = ( ( operatorIndex * maxParallelism + parallelism - 1 ) / parallelism ) ; int end = ( ( operatorIndex + 1 ) * maxParallelism - 1 ) / parallelism ; return new KeyGroupRange ( start , end ) ; }
Computes the range of key - groups that are assigned to a given operator under the given parallelism and maximum parallelism .