Optimal operator replication and placement for distributed stream processing systems