How To Quickly Implement A New Engine
1.Create a new maven module and introduce the maven dependency of “ECP”:
2.The main interfaces of implementing “ECP”:
Actual Case
The following will take the Hive engine as case to illustrate the implementation of each interface. The following figure is what is needed to implement a Hive engine All core classes implemented.
Hive engine is an interactive engine, so when implementing Executor, it inherits “ComputationExecutor” and introduces the following maven dependencies:
The Hive engine only needs to execute the HQL Executor, which is a single executor engine. Therefore, when defining “HiveEngineConnFactory”, it inherits “SingleExecutorEngineConnFactory” which implements the following two interfaces: a) createEngineConn: creates a object that contains “UserGroupInformation”, “SessionState” adn “HiveConf” as an encapsulation of the connection information with the underlying engine, set to the EngineConn object to return. b) createExecutor: creates a “HiveEngineConnExecutor” executor object based on the current engine connection information.
Hive engine is an ordinary Java process, so when implementing “EngineConnLaunchBuilder”, it directly inherits “JavaProcessEngineConnLaunchBuilder”. Like memory size, Java parameters and classPath, it can be adjusted through configuration, please refer to “EnvConfiguration” class for details.
Implement “HiveEngineConnPlugin” and provide methods for creating the above implementation classes.