[Refactor][Engine] Refactor flink engine (#509)