The ResultPartition and InputGate are created in Task currently. Based on pluggable ShuffleManager, they should be created via ShuffleService.
The NetworkEnvironment would be refactored into NetworkShuffleService future. So we migrate the process of creating ResultPartition and InputGate into current NetworkEnvironment. The BufferPool and metrics setup can also be done after the creation. Then we can remove the process of NetworkEnvironment#registerTask.