461
// time and space, so we should limit the n that we pass to it. Reduce the partition id by some
462
// factor and move that factor into the name.
464
>
if batch == 0 {
465
>
// For the first batch, omit the batch number as if batchSize==0 so that the root
466
>
// partition (id 0, batch number 0) doesn't move if we turn on/off spreading.
467
>
return fmt.Sprintf("%s:%s:%d", p.NamespaceId(), p.TaskQueue().Name(), p.TaskType()), p.partitionId
468
>
}
469
// For subsequent batches, put the batch number in the key to hash.
470
return fmt.Sprintf("%s:%s:%d:%d", p.NamespaceId(), p.TaskQueue().Name(), batch, p.TaskType()),