Task allocation for distributed stream processing