Task.inputGatesById indexes SingleInputGates by id. The end user of this indexing is NetworkEnviroment for two cases:
- SingleInputGate triggers producer partition readiness check and then the successful result of check is dispatched back to this SingleInputGate by id. We can just add an additional argument to TaskActions.triggerPartitionProducerStateCheck. The argument is an immediate callback to that SingleInputGate. Then inputGatesById is not needed for dispatching.
- TaskExecutor.updatePartitions uses inputGatesById to dispatch PartitionInfo update to the right SingleInputGate. If inputGatesById is moved to NetworkEnviroment, which should be a better place for gate management, and add NetworkEnviroment.updatePartitionInfo then TaskExecutor.updatePartitions could directly call NetworkEnviroment.updatePartitionInfo.