Skip to content

Commit

Permalink
Data source service forwarding optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
peacewong committed Oct 16, 2023
1 parent 8cf5f66 commit 95f229a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ object RPCConfiguration {
"cs,contextservice,data-source-manager,metadataQuery,metadatamanager,query,jobhistory,application,configuration,filesystem,udf,variable,microservice,errorcode,bml,datasource,basedata-manager"
).getValue.split(",")

val METADATAQUERY_SERVICE_APPLICATION_NAME: CommonVars[String] =
CommonVars("wds.linkis.gateway.conf.publicservice.name", "linkis-ps-metadataquery")

val METADATAQUERY_SERVICE_LIST: Array[String] = CommonVars(
"wds.linkis.gateway.conf.metadataquery.list",
"metadatamanager,metadataquery"
).getValue.split(",")

val LINKIS_MANAGER_SERVICE_NAME: CommonVars[String] =
CommonVars("wds.linkis.gateway.conf.linkismanager.name", "linkis-cg-linkismanager")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ class DefaultGatewayParser(gatewayParsers: Array[GatewayParser]) extends Abstrac
gatewayContext.getGatewayRoute.setRequestURI(path)
}
gatewayParsers.foreach(_.parse(gatewayContext))

/**
* Gateway forwarding logic: PublicService Service exists and is effective And then judge
* metadataquery Service, Continue to judge linkismanager Service, Final judgment
* linkispsdatasource Service
*/
if (gatewayContext.getGatewayRoute.getServiceInstance == null) path match {
case CLIENT_HEARTBEAT_REGEX(version) =>
if (sendResponseWhenNotMatchVersion(gatewayContext, version)) return
Expand All @@ -122,10 +128,11 @@ class DefaultGatewayParser(gatewayParsers: Array[GatewayParser]) extends Abstrac
) {
RPCConfiguration.PUBLIC_SERVICE_APPLICATION_NAME.getValue
// In order to be compatible with metadata module name refactoring,this logic will be removed in subsequent versions
} else if (RPCConfiguration.METADATAQUERY_SERVICE_LIST.contains(serviceId)) {
RPCConfiguration.METADATAQUERY_SERVICE_APPLICATION_NAME.getValue
} else if (RPCConfiguration.LINKIS_DATASOURCE_SERVICE_LIST.contains(serviceId)) {
RPCConfiguration.LINKIS_DATASOURCE_SERVICE_NAME.getValue
} else if (RPCConfiguration.LINKIS_MANAGER_SERVICE_LIST.contains(serviceId)) {
RPCConfiguration.LINKIS_MANAGER_SERVICE_NAME.getValue
// After the complete merge is completed, it needs to be removed
} else {
serviceId
}
Expand Down

0 comments on commit 95f229a

Please sign in to comment.