toGroupKey

fun AggregateIdCapable.toGroupKey(parallelism: Int = DEFAULT_PARALLELISM): Int

Computes a grouping key for parallel processing based on the aggregate ID.

Uses modulo operation to distribute aggregate IDs across parallel groups.

Return

An integer key between 0 and parallelism-1

Parameters

parallelism

The number of parallel groups (default: DEFAULT_PARALLELISM)