dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Improvement][API] Extract the function `getConnection` from the `DataSourceService.java` as a public function

Open yy0812 opened this issue 6 years ago • 0 comments

Describe the question Extract the function getConnection(DbType dbType, String parameter)from theDataSourceService.java` as a public function

What are the current deficiencies and the benefits of improvement

  • The getConnection function, which can be used to read/write data in addition to testing the database connection, currently exists as a private function in the 'datasourceservice.java' class:
  1. The function itself has nothing to do with the DataSource; its relationship to the function within the DataSourceService should be called/invoked rather than included.
  2. Bad for function reuse.
  3. When writing a test case for a DataSourceService, it is not easy to use the mock agent to mock its execution results because it is a private function

Which version of DolphinScheduler: -[dev]

yy0812 avatar Aug 25 '20 03:08 yy0812