Set up stream reduction.