Closed beliefer closed 4 years ago
The current implement of MongoManager some violations of programming. The trait DataSourceManager define a template function listTables show below:
MongoManager
DataSourceManager
listTables
/** * Display the tables of specified database. */ override def listTables(db: String): Seq[String] = { throw new UnsupportedOperationException(s"List ${shortName()} table not supported!") } /** * Display the tables of specified database with pattern. */ override def listTables(dbName: String, pattern: String): Seq[String] = { StringUtils.filterPattern(listTables(dbName), pattern) }
The design require the specific data source to implement listTables(db: String), but MongoManager overwrite the template function show below:
listTables(db: String)
override def listTables(dsName: String, dbName: String): Seq[String] = { val mongoDB = mongoClient.getDatabase(dbName) mongoDB.listCollectionNames().asScala.toSeq }
It will causes some bug. I think should to improve the implement to make MongoManager more consistent with the design.
No UT.
LGTM
@WeiWenda Thanks.
What changes were proposed in this pull request?
The current implement of
MongoManager
some violations of programming. The traitDataSourceManager
define a template functionlistTables
show below:The design require the specific data source to implement
listTables(db: String)
, but MongoManager overwrite the template function show below:It will causes some bug. I think should to improve the implement to make
MongoManager
more consistent with the design.How was this patch tested?
No UT.