This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.2.0
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.2.0 by this push:
new f7b454791 Opt refactor entrance bean conf (#2496)
f7b454791 is described below
commit f7b454791a0b8ebedcbf97cc4e7989f0da78eb19
Author: Jack Xu <[email protected]>
AuthorDate: Sun Jul 24 10:36:20 2022 +0800
Opt refactor entrance bean conf (#2496)
* refactor(linkis-entrance): refactor linkis-entrance's spring bean config
---
.../linkis/common/conf/BDPConfiguration.scala | 4 +-
.../BackGroundServiceBeanAnnotation.java | 58 --------
.../annotation/CliHeartBeatMonitorAnnotation.java | 58 --------
.../annotation/ConsumerManagerBeanAnnotation.java | 58 --------
.../annotation/EngineBuilderBeanAnnotation.java | 58 --------
.../annotation/EngineManagerBeanAnnotation.java | 55 -------
.../annotation/EngineRequesterBeanAnnotation.java | 58 --------
.../annotation/EngineSelectorBeanAnnotation.java | 58 --------
.../annotation/EntranceContextBeanAnnotation.java | 58 --------
.../EntranceInterceptorBeanAnnotation.java | 58 --------
.../EntranceListenerBusBeanAnnotation.java | 58 --------
.../EntranceLogListenerBusBeanAnnotation.java | 58 --------
.../ErrorCodeListenerBeanAnnotation.java | 58 --------
.../annotation/ErrorCodeManagerBeanAnnotation.java | 58 --------
.../annotation/GroupFactoryBeanAnnotation.java | 58 --------
.../annotation/LogManagerBeanAnnotation.java | 58 --------
.../NewEngineBroadcastListenerBeanAnnotation.java | 58 --------
.../PersistenceManagerBeanAnnotation.java | 58 --------
.../annotation/ReceiverChooserBeanAnnotation.java | 58 --------
...atusChangedBroadcastListenerBeanAnnotation.java | 58 --------
.../annotation/ResultSetEngineBeanAnnotation.java | 58 --------
.../annotation/SchedulerBeanAnnotation.java | 58 --------
.../annotation/SchedulerContextBeanAnnotation.java | 58 --------
.../entrance/conf/EntranceSpringConfiguration.java | 165 +++++++++++----------
.../entrance/constant/ServiceNameConsts.java | 29 ++++
.../entrance/context/DefaultEntranceContext.java | 38 ++---
.../entrance/restful/EntranceMetricRestfulApi.java | 9 +-
.../entrance/restful/EntranceRestfulApi.java | 18 ++-
.../entrance/server/DefaultEntranceServer.java | 10 +-
.../apache/linkis/entrance/EntranceServer.scala | 24 +--
.../linkis/entrance/log/ErrorCodeManager.scala | 76 +---------
.../http/GatewayAuthorizationFilter.java | 34 +----
.../http/SpringCloudGatewayHttpRequest.scala | 28 +---
.../http/SpringCloudGatewayHttpResponse.scala | 11 +-
.../SpringCloudGatewayWebsocketUtils.scala | 10 +-
35 files changed, 195 insertions(+), 1534 deletions(-)
diff --git
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/BDPConfiguration.scala
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/BDPConfiguration.scala
index 9ea2ffb92..26d491a6d 100644
---
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/BDPConfiguration.scala
+++
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/BDPConfiguration.scala
@@ -54,10 +54,10 @@ private[conf] object BDPConfiguration extends Logging {
val serverConf = sysProps.getOrElse("wds.linkis.server.conf",
DEFAULT_SERVER_CONF_FILE_NAME)
val serverConfFileURL = getClass.getClassLoader.getResource(serverConf)
if (serverConfFileURL != null && new
File(serverConfFileURL.getPath).exists) {
- logger.warn(s"******************************** Notice: The Linkis
serverConf file is $propertyFile ! ***************************")
+ logger.warn(s"******************************** Notice: The Linkis
serverConf file is $serverConf ! ***************************")
initConfig(config, serverConfFileURL.getPath)
}
- else logger.warn(s"******************************** Notice: The Linkis
serverConf file $serverConfFileURL is not exists! ***************************")
+ else logger.warn(s"******************************** Notice: The Linkis
serverConf file $serverConf is not exists! ***************************")
// load server confs
val propertyFileOptions = sysProps.get("wds.linkis.server.confs")
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/BackGroundServiceBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/BackGroundServiceBeanAnnotation.java
deleted file mode 100644
index 2382e87e8..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/BackGroundServiceBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = BackGroundServiceBeanAnnotation.BEAN_NAME)
-@Component(value = BackGroundServiceBeanAnnotation.BEAN_NAME)
-public @interface BackGroundServiceBeanAnnotation {
- String BEAN_NAME = "backGroundServices";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface BackGroundServiceAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/CliHeartBeatMonitorAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/CliHeartBeatMonitorAnnotation.java
deleted file mode 100644
index e263b32d9..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/CliHeartBeatMonitorAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = CliHeartBeatMonitorAnnotation.BEAN_NAME)
-@Component(value = CliHeartBeatMonitorAnnotation.BEAN_NAME)
-public @interface CliHeartBeatMonitorAnnotation {
- String BEAN_NAME = "cliHeartBeatMonitor";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface CliHeartBeatMonitorAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ConsumerManagerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ConsumerManagerBeanAnnotation.java
deleted file mode 100644
index 5f86d7fd6..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ConsumerManagerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = ConsumerManagerBeanAnnotation.BEAN_NAME)
-@Component(value = ConsumerManagerBeanAnnotation.BEAN_NAME)
-public @interface ConsumerManagerBeanAnnotation {
- String BEAN_NAME = "consumerManager";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface ConsumerManagerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineBuilderBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineBuilderBeanAnnotation.java
deleted file mode 100644
index ccaf6f947..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineBuilderBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EngineBuilderBeanAnnotation.BEAN_NAME)
-@Component(value = EngineBuilderBeanAnnotation.BEAN_NAME)
-public @interface EngineBuilderBeanAnnotation {
- String BEAN_NAME = "engineBuilder";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EngineBuilderAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineManagerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineManagerBeanAnnotation.java
deleted file mode 100644
index 937bd1938..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineManagerBeanAnnotation.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EngineManagerBeanAnnotation.BEAN_NAME)
-@Component(value = EngineManagerBeanAnnotation.BEAN_NAME)
-public @interface EngineManagerBeanAnnotation {
- String BEAN_NAME = "engineManager";
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EngineManagerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineRequesterBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineRequesterBeanAnnotation.java
deleted file mode 100644
index 26b72bbf2..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineRequesterBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EngineRequesterBeanAnnotation.BEAN_NAME)
-@Component(value = EngineRequesterBeanAnnotation.BEAN_NAME)
-public @interface EngineRequesterBeanAnnotation {
- String BEAN_NAME = "engineRequester";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EngineRequesterAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineSelectorBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineSelectorBeanAnnotation.java
deleted file mode 100644
index cad47c984..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EngineSelectorBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EngineSelectorBeanAnnotation.BEAN_NAME)
-@Component(value = EngineSelectorBeanAnnotation.BEAN_NAME)
-public @interface EngineSelectorBeanAnnotation {
- String BEAN_NAME = "engineSelector";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EngineSelectorAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceContextBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceContextBeanAnnotation.java
deleted file mode 100644
index 25b9e029a..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceContextBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EntranceContextBeanAnnotation.BEAN_NAME)
-@Component(value = EntranceContextBeanAnnotation.BEAN_NAME)
-public @interface EntranceContextBeanAnnotation {
- String BEAN_NAME = "entranceContext";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EntranceContextAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceInterceptorBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceInterceptorBeanAnnotation.java
deleted file mode 100644
index 33342d7ae..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceInterceptorBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EntranceInterceptorBeanAnnotation.BEAN_NAME)
-@Component(value = EntranceInterceptorBeanAnnotation.BEAN_NAME)
-public @interface EntranceInterceptorBeanAnnotation {
- String BEAN_NAME = "entranceInterceptors";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EntranceInterceptorAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceListenerBusBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceListenerBusBeanAnnotation.java
deleted file mode 100644
index e6ab8e67b..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceListenerBusBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EntranceListenerBusBeanAnnotation.BEAN_NAME)
-@Component(value = EntranceListenerBusBeanAnnotation.BEAN_NAME)
-public @interface EntranceListenerBusBeanAnnotation {
- String BEAN_NAME = "entranceListenerBus";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EntranceListenerBusAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceLogListenerBusBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceLogListenerBusBeanAnnotation.java
deleted file mode 100644
index d77285762..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/EntranceLogListenerBusBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = EntranceLogListenerBusBeanAnnotation.BEAN_NAME)
-@Component(value = EntranceLogListenerBusBeanAnnotation.BEAN_NAME)
-public @interface EntranceLogListenerBusBeanAnnotation {
- String BEAN_NAME = "entranceLogListenerBus";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface EntranceLogListenerBusAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeListenerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeListenerBeanAnnotation.java
deleted file mode 100644
index b59edc5d7..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeListenerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = ErrorCodeListenerBeanAnnotation.BEAN_NAME)
-@Component(value = ErrorCodeListenerBeanAnnotation.BEAN_NAME)
-public @interface ErrorCodeListenerBeanAnnotation {
- String BEAN_NAME = "errorCodeListener";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface ErrorCodeListenerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeManagerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeManagerBeanAnnotation.java
deleted file mode 100644
index 780759d4a..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ErrorCodeManagerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = ErrorCodeManagerBeanAnnotation.BEAN_NAME)
-@Component(value = ErrorCodeManagerBeanAnnotation.BEAN_NAME)
-public @interface ErrorCodeManagerBeanAnnotation {
- String BEAN_NAME = "errorCodeManager";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface ErrorCodeManagerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/GroupFactoryBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/GroupFactoryBeanAnnotation.java
deleted file mode 100644
index 36ea84b24..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/GroupFactoryBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = GroupFactoryBeanAnnotation.BEAN_NAME)
-@Component(value = GroupFactoryBeanAnnotation.BEAN_NAME)
-public @interface GroupFactoryBeanAnnotation {
- String BEAN_NAME = "groupFactory";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface GroupFactoryAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/LogManagerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/LogManagerBeanAnnotation.java
deleted file mode 100644
index 6d314f912..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/LogManagerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = LogManagerBeanAnnotation.BEAN_NAME)
-@Component(value = LogManagerBeanAnnotation.BEAN_NAME)
-public @interface LogManagerBeanAnnotation {
- String BEAN_NAME = "logManager";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface LogManagerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/NewEngineBroadcastListenerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/NewEngineBroadcastListenerBeanAnnotation.java
deleted file mode 100644
index 5fc4b0994..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/NewEngineBroadcastListenerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = NewEngineBroadcastListenerBeanAnnotation.BEAN_NAME)
-@Component(value = NewEngineBroadcastListenerBeanAnnotation.BEAN_NAME)
-public @interface NewEngineBroadcastListenerBeanAnnotation {
- String BEAN_NAME = "newEngineBroadcastListener";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface NewEngineBroadcastListenerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/PersistenceManagerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/PersistenceManagerBeanAnnotation.java
deleted file mode 100644
index 0e74e4a3f..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/PersistenceManagerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = PersistenceManagerBeanAnnotation.BEAN_NAME)
-@Component(value = PersistenceManagerBeanAnnotation.BEAN_NAME)
-public @interface PersistenceManagerBeanAnnotation {
- String BEAN_NAME = "persistenceManager";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface PersistenceManagerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ReceiverChooserBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ReceiverChooserBeanAnnotation.java
deleted file mode 100644
index eaf88fd7d..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ReceiverChooserBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = ReceiverChooserBeanAnnotation.BEAN_NAME)
-@Component(value = ReceiverChooserBeanAnnotation.BEAN_NAME)
-public @interface ReceiverChooserBeanAnnotation {
- String BEAN_NAME = "entranceReceiverChooser";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface BackGroundServiceAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResponseEngineStatusChangedBroadcastListenerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResponseEngineStatusChangedBroadcastListenerBeanAnnotation.java
deleted file mode 100644
index dccb71d34..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResponseEngineStatusChangedBroadcastListenerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value =
ResponseEngineStatusChangedBroadcastListenerBeanAnnotation.BEAN_NAME)
-@Component(value =
ResponseEngineStatusChangedBroadcastListenerBeanAnnotation.BEAN_NAME)
-public @interface ResponseEngineStatusChangedBroadcastListenerBeanAnnotation {
- String BEAN_NAME = "responseEngineStatusChangedBroadcastListener";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface ResponseEngineStatusChangedBroadcastListenerAutowiredAnnotation
{
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResultSetEngineBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResultSetEngineBeanAnnotation.java
deleted file mode 100644
index 51d569d06..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/ResultSetEngineBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = ResultSetEngineBeanAnnotation.BEAN_NAME)
-@Component(value = ResultSetEngineBeanAnnotation.BEAN_NAME)
-public @interface ResultSetEngineBeanAnnotation {
- String BEAN_NAME = "resultSetEngine";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface ResultSetEngineAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerBeanAnnotation.java
deleted file mode 100644
index 3aa07c3b3..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = SchedulerBeanAnnotation.BEAN_NAME)
-@Component(value = SchedulerBeanAnnotation.BEAN_NAME)
-public @interface SchedulerBeanAnnotation {
- String BEAN_NAME = "scheduler";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface SchedulerAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerContextBeanAnnotation.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerContextBeanAnnotation.java
deleted file mode 100644
index 9c80af9e9..000000000
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/annotation/SchedulerContextBeanAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.entrance.annotation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.stereotype.Component;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Bean(value = SchedulerContextBeanAnnotation.BEAN_NAME)
-@Component(value = SchedulerContextBeanAnnotation.BEAN_NAME)
-public @interface SchedulerContextBeanAnnotation {
- String BEAN_NAME = "schedulerContext";
-
- @AliasFor(annotation = Component.class)
- String value() default BEAN_NAME;
-
- @Target({
- ElementType.CONSTRUCTOR,
- ElementType.FIELD,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PARAMETER
- })
- @Retention(RetentionPolicy.RUNTIME)
- @Qualifier(BEAN_NAME)
- @Autowired
- @interface SchedulerContextAutowiredAnnotation {
- @AliasFor(annotation = Qualifier.class)
- String value() default BEAN_NAME;
-
- @AliasFor(annotation = Autowired.class)
- boolean required() default true;
- }
-}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/conf/EntranceSpringConfiguration.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/conf/EntranceSpringConfiguration.java
index 02ec26a54..703c04f5c 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/conf/EntranceSpringConfiguration.java
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/conf/EntranceSpringConfiguration.java
@@ -18,17 +18,41 @@
package org.apache.linkis.entrance.conf;
import org.apache.linkis.entrance.EntranceParser;
-import org.apache.linkis.entrance.annotation.*;
import org.apache.linkis.entrance.cli.heartbeat.CliHeartbeatMonitor;
import org.apache.linkis.entrance.cli.heartbeat.KillHandler;
-import org.apache.linkis.entrance.event.*;
+import org.apache.linkis.entrance.constant.ServiceNameConsts;
+import org.apache.linkis.entrance.event.EntranceEvent;
+import org.apache.linkis.entrance.event.EntranceEventListener;
+import org.apache.linkis.entrance.event.EntranceEventListenerBus;
import org.apache.linkis.entrance.execute.impl.EntranceExecutorManagerImpl;
import org.apache.linkis.entrance.interceptor.EntranceInterceptor;
import org.apache.linkis.entrance.interceptor.OnceJobInterceptor;
-import org.apache.linkis.entrance.interceptor.impl.*;
-import org.apache.linkis.entrance.log.*;
+import org.apache.linkis.entrance.interceptor.impl.CSEntranceInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.CommentInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.CompatibleInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.LabelCheckInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.LogPathCreateInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.ParserVarLabelInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.SQLCodeCheckInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.SQLLimitEntranceInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.ScalaCodeInterceptor;
+import
org.apache.linkis.entrance.interceptor.impl.ShellDangerousGrammerInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.SparkCodeCheckInterceptor;
+import
org.apache.linkis.entrance.interceptor.impl.StorePathEntranceInterceptor;
+import org.apache.linkis.entrance.interceptor.impl.VarSubstitutionInterceptor;
+import org.apache.linkis.entrance.log.CacheLogManager;
+import org.apache.linkis.entrance.log.ErrorCodeListener;
+import org.apache.linkis.entrance.log.ErrorCodeManager;
+import org.apache.linkis.entrance.log.FlexibleErrorCodeManager$;
+import org.apache.linkis.entrance.log.LogManager;
+import org.apache.linkis.entrance.log.PersistenceErrorCodeListener;
import org.apache.linkis.entrance.parser.CommonEntranceParser;
-import org.apache.linkis.entrance.persistence.*;
+import org.apache.linkis.entrance.persistence.EntranceResultSetEngine;
+import org.apache.linkis.entrance.persistence.PersistenceEngine;
+import org.apache.linkis.entrance.persistence.PersistenceManager;
+import org.apache.linkis.entrance.persistence.QueryPersistenceEngine;
+import org.apache.linkis.entrance.persistence.QueryPersistenceManager;
+import org.apache.linkis.entrance.persistence.ResultSetEngine;
import org.apache.linkis.entrance.scheduler.EntranceGroupFactory;
import org.apache.linkis.entrance.scheduler.EntranceSchedulerContext;
import org.apache.linkis.orchestrator.ecm.EngineConnManagerBuilder;
@@ -43,6 +67,7 @@ import
org.apache.linkis.scheduler.queue.parallelqueue.ParallelConsumerManager;
import org.apache.linkis.scheduler.queue.parallelqueue.ParallelScheduler;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.slf4j.Logger;
@@ -55,7 +80,6 @@ import static
org.apache.linkis.entrance.conf.EntranceConfiguration.ENTRANCE_SCH
* module.(该配置类用于生成entrance模块中的一些单例类)
*/
@Configuration
-// @AutoConfigureBefore({EntranceServer.class, EntranceExecutionService.class})
public class EntranceSpringConfiguration {
private Logger logger = LoggerFactory.getLogger(getClass());
@@ -64,35 +88,32 @@ public class EntranceSpringConfiguration {
logger.info("load the linkis-cg-entrance spring configuration.");
}
- @PersistenceEngineBeanAnnotation
- @ConditionalOnMissingBean(name =
{PersistenceEngineBeanAnnotation.BEAN_NAME})
- public PersistenceEngine generatePersistenceEngine() {
+ @Bean
+ @ConditionalOnMissingBean
+ public PersistenceEngine persistenceEngine() {
return new QueryPersistenceEngine();
}
- @ResultSetEngineBeanAnnotation
- @ConditionalOnMissingBean(name = {ResultSetEngineBeanAnnotation.BEAN_NAME})
- public ResultSetEngine generateResultSetEngine() {
+ @Bean
+ @ConditionalOnMissingBean
+ public ResultSetEngine resultSetEngine() {
return new EntranceResultSetEngine();
}
- @CliHeartBeatMonitorAnnotation
- @ConditionalOnMissingBean(name = {CliHeartBeatMonitorAnnotation.BEAN_NAME})
- public CliHeartbeatMonitor generateCliHeartbeatMonitor() {
+ @Bean
+ @ConditionalOnMissingBean
+ public CliHeartbeatMonitor cliHeartbeatMonitor() {
CliHeartbeatMonitor cliHeartbeatMonitor = new CliHeartbeatMonitor(new
KillHandler());
cliHeartbeatMonitor.start();
return cliHeartbeatMonitor;
}
- @PersistenceManagerBeanAnnotation
- @ConditionalOnMissingBean(name =
{PersistenceManagerBeanAnnotation.BEAN_NAME})
- public PersistenceManager generatePersistenceManager(
-
@PersistenceEngineBeanAnnotation.PersistenceEngineAutowiredAnnotation
- PersistenceEngine persistenceEngine,
- @ResultSetEngineBeanAnnotation.ResultSetEngineAutowiredAnnotation
- ResultSetEngine resultSetEngine,
-
@CliHeartBeatMonitorAnnotation.CliHeartBeatMonitorAutowiredAnnotation
- CliHeartbeatMonitor cliHeartbeatMonitor) {
+ @Bean
+ @ConditionalOnMissingBean
+ public PersistenceManager persistenceManager(
+ PersistenceEngine persistenceEngine,
+ ResultSetEngine resultSetEngine,
+ CliHeartbeatMonitor cliHeartbeatMonitor) {
logger.info("init PersistenceManager.");
QueryPersistenceManager persistenceManager = new
QueryPersistenceManager();
persistenceManager.setPersistenceEngine(persistenceEngine);
@@ -101,20 +122,18 @@ public class EntranceSpringConfiguration {
return persistenceManager;
}
- @EntranceParserBeanAnnotation
- @ConditionalOnMissingBean(name = {EntranceParserBeanAnnotation.BEAN_NAME})
- public EntranceParser generateEntranceParser(
-
@PersistenceManagerBeanAnnotation.PersistenceManagerAutowiredAnnotation
- PersistenceManager persistenceManager) {
+ @Bean
+ @ConditionalOnMissingBean
+ public EntranceParser entranceParser(PersistenceManager
persistenceManager) {
return new CommonEntranceParser(persistenceManager);
}
- @EntranceListenerBusBeanAnnotation
- @ConditionalOnMissingBean(name =
{EntranceListenerBusBeanAnnotation.BEAN_NAME})
+ @Bean
+ @ConditionalOnMissingBean
public EntranceEventListenerBus<EntranceEventListener, EntranceEvent>
- generateEntranceEventListenerBus() {
+ entranceEventListenerBus() {
EntranceEventListenerBus<EntranceEventListener, EntranceEvent>
entranceEventListenerBus =
- new EntranceEventListenerBus<EntranceEventListener,
EntranceEvent>();
+ new EntranceEventListenerBus<>();
entranceEventListenerBus.start();
return entranceEventListenerBus;
}
@@ -124,9 +143,9 @@ public class EntranceSpringConfiguration {
*
* @return
*/
- @EntranceInterceptorBeanAnnotation
- @ConditionalOnMissingBean(name =
{EntranceInterceptorBeanAnnotation.BEAN_NAME})
- public EntranceInterceptor[] generateEntranceInterceptors() {
+ @Bean
+ @ConditionalOnMissingBean(name = {ServiceNameConsts.ENTRANCE_INTERCEPTOR})
+ public EntranceInterceptor[] entranceInterceptors() {
return new EntranceInterceptor[] {
new OnceJobInterceptor(),
new CSEntranceInterceptor(),
@@ -147,82 +166,66 @@ public class EntranceSpringConfiguration {
};
}
- @ErrorCodeListenerBeanAnnotation
- @ConditionalOnMissingBean(name =
{ErrorCodeListenerBeanAnnotation.BEAN_NAME})
- public ErrorCodeListener generateErrorCodeListener(
-
@PersistenceManagerBeanAnnotation.PersistenceManagerAutowiredAnnotation
- PersistenceManager persistenceManager,
- @EntranceParserBeanAnnotation.EntranceParserAutowiredAnnotation
- EntranceParser entranceParser) {
+ @Bean
+ @ConditionalOnMissingBean
+ public ErrorCodeListener errorCodeListener(
+ PersistenceManager persistenceManager, EntranceParser
entranceParser) {
PersistenceErrorCodeListener errorCodeListener = new
PersistenceErrorCodeListener();
errorCodeListener.setEntranceParser(entranceParser);
errorCodeListener.setPersistenceManager(persistenceManager);
return errorCodeListener;
}
- @ErrorCodeManagerBeanAnnotation
- @ConditionalOnMissingBean(name =
{ErrorCodeManagerBeanAnnotation.BEAN_NAME})
- public ErrorCodeManager generateErrorCodeManager() {
- /* try {
-
Class.forName("org.apache.linkis.errorcode.client.handler.LinkisErrorCodeHandler");
- } catch (final Exception e) {
- logger.error("failed to init linkis error code handler", e);
- }*/
+ @Bean
+ @ConditionalOnMissingBean
+ public ErrorCodeManager errorCodeManager() {
return FlexibleErrorCodeManager$.MODULE$;
}
- @LogManagerBeanAnnotation
- @ConditionalOnMissingBean(name = {LogManagerBeanAnnotation.BEAN_NAME})
- public LogManager generateLogManager(
-
@ErrorCodeListenerBeanAnnotation.ErrorCodeListenerAutowiredAnnotation
- ErrorCodeListener errorCodeListener,
- @ErrorCodeManagerBeanAnnotation.ErrorCodeManagerAutowiredAnnotation
- ErrorCodeManager errorCodeManager) {
+ @Bean
+ @ConditionalOnMissingBean
+ public LogManager logManager(
+ ErrorCodeListener errorCodeListener, ErrorCodeManager
errorCodeManager) {
CacheLogManager logManager = new CacheLogManager();
logManager.setErrorCodeListener(errorCodeListener);
logManager.setErrorCodeManager(errorCodeManager);
return logManager;
}
- @GroupFactoryBeanAnnotation
- @ConditionalOnMissingBean(name = {GroupFactoryBeanAnnotation.BEAN_NAME})
- public GroupFactory generateGroupFactory() {
+ @Bean
+ @ConditionalOnMissingBean
+ public GroupFactory groupFactory() {
return new EntranceGroupFactory();
}
- @ConsumerManagerBeanAnnotation
- @ConditionalOnMissingBean(name = {ConsumerManagerBeanAnnotation.BEAN_NAME})
- public ConsumerManager generateConsumerManager() {
+ @Bean
+ @ConditionalOnMissingBean
+ public ConsumerManager consumerManager() {
return new ParallelConsumerManager(
ENTRANCE_SCHEDULER_MAX_PARALLELISM_USERS().getValue(),
"EntranceJobScheduler");
}
- @SchedulerContextBeanAnnotation
- @ConditionalOnMissingBean(name =
{SchedulerContextBeanAnnotation.BEAN_NAME})
- public SchedulerContext generateSchedulerContext(
- @GroupFactoryBeanAnnotation.GroupFactoryAutowiredAnnotation
GroupFactory groupFactory,
-
@EntranceExecutorManagerBeanAnnotation.EntranceExecutorManagerAutowiredAnnotation
- ExecutorManager executorManager,
- @ConsumerManagerBeanAnnotation.ConsumerManagerAutowiredAnnotation
- ConsumerManager consumerManager) {
+ @Bean
+ @ConditionalOnMissingBean
+ public SchedulerContext schedulerContext(
+ GroupFactory groupFactory,
+ ExecutorManager executorManager,
+ ConsumerManager consumerManager) {
return new EntranceSchedulerContext(groupFactory, consumerManager,
executorManager);
}
- @EntranceExecutorManagerBeanAnnotation
- @ConditionalOnMissingBean(name =
{EntranceExecutorManagerBeanAnnotation.BEAN_NAME})
- public ExecutorManager generateExecutorManager(
- @GroupFactoryBeanAnnotation.GroupFactoryAutowiredAnnotation
GroupFactory groupFactory) {
+ @Bean
+ @ConditionalOnMissingBean
+ public ExecutorManager executorManager(GroupFactory groupFactory) {
EngineConnManagerBuilder engineConnManagerBuilder =
EngineConnManagerBuilder$.MODULE$.builder();
engineConnManagerBuilder.setPolicy(Policy.Process);
return new EntranceExecutorManagerImpl(groupFactory,
engineConnManagerBuilder.build());
}
- @SchedulerBeanAnnotation
- @ConditionalOnMissingBean(name = {SchedulerBeanAnnotation.BEAN_NAME})
- public Scheduler generateScheduler(
- @SchedulerContextBeanAnnotation.SchedulerContextAutowiredAnnotation
- SchedulerContext schedulerContext) {
+ @Bean
+ @ConditionalOnMissingBean
+ public Scheduler scheduler(SchedulerContext schedulerContext) {
Scheduler scheduler = new ParallelScheduler(schedulerContext);
scheduler.init();
scheduler.start();
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/constant/ServiceNameConsts.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/constant/ServiceNameConsts.java
new file mode 100644
index 000000000..51ae9499d
--- /dev/null
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/constant/ServiceNameConsts.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.entrance.constant;
+
+/** unify bean's spring config name */
+public final class ServiceNameConsts {
+ private ServiceNameConsts() {}
+
+ public static final String ENTRANCE_CONTEXT = "entranceContext";
+
+ public static final String ENTRANCE_SERVER = "entranceServer";
+
+ public static final String ENTRANCE_INTERCEPTOR = "entranceInterceptors";
+}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/context/DefaultEntranceContext.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/context/DefaultEntranceContext.java
index ad7d24986..afb2993f3 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/context/DefaultEntranceContext.java
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/context/DefaultEntranceContext.java
@@ -19,50 +19,54 @@ package org.apache.linkis.entrance.context;
import org.apache.linkis.entrance.EntranceContext;
import org.apache.linkis.entrance.EntranceParser;
-import org.apache.linkis.entrance.annotation.*;
-import org.apache.linkis.entrance.event.*;
+import org.apache.linkis.entrance.constant.ServiceNameConsts;
+import org.apache.linkis.entrance.event.EntranceEvent;
+import org.apache.linkis.entrance.event.EntranceEventListener;
+import org.apache.linkis.entrance.event.EntranceEventListenerBus;
import org.apache.linkis.entrance.interceptor.EntranceInterceptor;
import org.apache.linkis.entrance.log.LogManager;
import org.apache.linkis.entrance.persistence.PersistenceManager;
import org.apache.linkis.scheduler.Scheduler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@EntranceContextBeanAnnotation
+@Component(ServiceNameConsts.ENTRANCE_CONTEXT)
public class DefaultEntranceContext extends EntranceContext {
- private static Logger logger =
LoggerFactory.getLogger(DefaultEntranceContext.class);
+ private static final Logger logger =
LoggerFactory.getLogger(DefaultEntranceContext.class);
- @EntranceParserBeanAnnotation.EntranceParserAutowiredAnnotation
- private EntranceParser entranceParser;
+ @Autowired private EntranceParser entranceParser;
- @PersistenceManagerBeanAnnotation.PersistenceManagerAutowiredAnnotation
- private PersistenceManager persistenceManager;
+ @Autowired private PersistenceManager persistenceManager;
- @LogManagerBeanAnnotation.LogManagerAutowiredAnnotation private LogManager
logManager;
+ @Autowired private LogManager logManager;
- @SchedulerBeanAnnotation.SchedulerAutowiredAnnotation private Scheduler
scheduler;
+ @Autowired private Scheduler scheduler;
- @EntranceInterceptorBeanAnnotation.EntranceInterceptorAutowiredAnnotation
- private EntranceInterceptor[] interceptors;
+ @Autowired
+ @Qualifier(ServiceNameConsts.ENTRANCE_INTERCEPTOR)
+ private EntranceInterceptor[] entranceInterceptors;
- @EntranceListenerBusBeanAnnotation.EntranceListenerBusAutowiredAnnotation
- private EntranceEventListenerBus<EntranceEventListener, EntranceEvent>
listenerBus;
+ @Autowired private EntranceEventListenerBus<EntranceEventListener,
EntranceEvent> listenerBus;
public DefaultEntranceContext(
EntranceParser entranceParser,
PersistenceManager persistenceManager,
LogManager logManager,
Scheduler scheduler,
- EntranceInterceptor[] interceptors,
+ EntranceInterceptor[] entranceInterceptors,
EntranceEventListenerBus<EntranceEventListener, EntranceEvent>
listenerBus) {
this.entranceParser = entranceParser;
this.persistenceManager = persistenceManager;
this.logManager = logManager;
this.scheduler = scheduler;
- this.interceptors = interceptors;
+ this.entranceInterceptors = entranceInterceptors;
this.listenerBus = listenerBus;
}
@@ -88,7 +92,7 @@ public class DefaultEntranceContext extends EntranceContext {
@Override
public EntranceInterceptor[] getOrCreateEntranceInterceptors() {
- return interceptors;
+ return entranceInterceptors;
}
@Override
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceMetricRestfulApi.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceMetricRestfulApi.java
index e0216d28e..b6dcddb76 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceMetricRestfulApi.java
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceMetricRestfulApi.java
@@ -19,7 +19,6 @@ package org.apache.linkis.entrance.restful;
import org.apache.linkis.common.conf.Configuration;
import org.apache.linkis.entrance.EntranceServer;
-import org.apache.linkis.entrance.annotation.EntranceServerBeanAnnotation;
import org.apache.linkis.entrance.execute.EntranceJob;
import org.apache.linkis.manager.label.entity.engine.EngineTypeLabel;
import org.apache.linkis.manager.label.utils.LabelUtil;
@@ -28,7 +27,11 @@ import org.apache.linkis.server.utils.ModuleUserUtils;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@@ -43,7 +46,7 @@ public class EntranceMetricRestfulApi {
private static final Logger logger =
LoggerFactory.getLogger(EntranceMetricRestfulApi.class);
- @EntranceServerBeanAnnotation.EntranceServerAutowiredAnnotation
+ @Autowired
public void setEntranceServer(EntranceServer entranceServer) {
this.entranceServer = entranceServer;
}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
index 1c306b4f6..4f871c31d 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
@@ -19,7 +19,6 @@ package org.apache.linkis.entrance.restful;
import org.apache.linkis.common.log.LogUtils;
import org.apache.linkis.entrance.EntranceServer;
-import org.apache.linkis.entrance.annotation.EntranceServerBeanAnnotation;
import org.apache.linkis.entrance.conf.EntranceConfiguration;
import org.apache.linkis.entrance.execute.EntranceJob;
import org.apache.linkis.entrance.log.LogReader;
@@ -42,7 +41,13 @@ import org.apache.linkis.server.utils.ModuleUserUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@@ -50,7 +55,12 @@ import com.fasterxml.jackson.databind.JsonNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
import scala.Option;
@@ -63,7 +73,7 @@ public class EntranceRestfulApi implements
EntranceRestfulRemote {
private static final Logger logger =
LoggerFactory.getLogger(EntranceRestfulApi.class);
- @EntranceServerBeanAnnotation.EntranceServerAutowiredAnnotation
+ @Autowired
public void setEntranceServer(EntranceServer entranceServer) {
this.entranceServer = entranceServer;
}
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/server/DefaultEntranceServer.java
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/server/DefaultEntranceServer.java
index 88ab59be0..597ea22ef 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/server/DefaultEntranceServer.java
+++
b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/server/DefaultEntranceServer.java
@@ -19,14 +19,15 @@ package org.apache.linkis.entrance.server;
import org.apache.linkis.entrance.EntranceContext;
import org.apache.linkis.entrance.EntranceServer;
-import org.apache.linkis.entrance.annotation.EntranceContextBeanAnnotation;
-import org.apache.linkis.entrance.annotation.EntranceServerBeanAnnotation;
+import org.apache.linkis.entrance.constant.ServiceNameConsts;
import org.apache.linkis.entrance.execute.EntranceJob;
import org.apache.linkis.entrance.log.LogReader;
import org.apache.linkis.rpc.Sender;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.EventListener;
+import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@@ -34,13 +35,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** Description: */
-@EntranceServerBeanAnnotation
+@Component(ServiceNameConsts.ENTRANCE_SERVER)
public class DefaultEntranceServer extends EntranceServer {
private static final Logger logger =
LoggerFactory.getLogger(DefaultEntranceServer.class);
- @EntranceContextBeanAnnotation.EntranceContextAutowiredAnnotation
- private EntranceContext entranceContext;
+ @Autowired private EntranceContext entranceContext;
private Boolean shutdownFlag = false;
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
index 6f0e65129..f625959f1 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
+++
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
@@ -58,7 +58,7 @@ abstract class EntranceServer extends Logging {
if (!params.containsKey(EntranceServer.DO_NOT_PRINT_PARAMS_LOG))
logger.debug("received a request: " + params)
else params.remove(EntranceServer.DO_NOT_PRINT_PARAMS_LOG)
var jobRequest =
getEntranceContext.getOrCreateEntranceParser().parseToTask(params)
- // tod multi entrance instances
+ //todo: multi entrance instances
jobRequest.setInstances(Sender.getThisInstance)
Utils.tryAndWarn(CSEntranceHelper.resetCreator(jobRequest))
//After parse the map into a jobRequest, we need to store it in the
database, and the jobRequest can get a unique taskID.
@@ -67,7 +67,7 @@ abstract class EntranceServer extends Logging {
if (null == jobRequest.getId || jobRequest.getId <= 0) {
throw new EntranceErrorException(20052, "Persist jobRequest error,
please submit again later(存储Job异常,请稍后重新提交任务)")
}
- logger.info(s"received a request,convert $jobRequest ")
+ logger.info(s"received a request,convert $jobRequest")
val logAppender = new java.lang.StringBuilder()
Utils.tryThrow(getEntranceContext.getOrCreateEntranceInterceptors().foreach(int
=> jobRequest = int.apply(jobRequest, logAppender))) { t =>
@@ -95,7 +95,7 @@ abstract class EntranceServer extends Logging {
}
val job =
getEntranceContext.getOrCreateEntranceParser().parseToJob(jobRequest)
- Utils.tryThrow{
+ Utils.tryThrow {
job.init()
job.setLogListener(getEntranceContext.getOrCreateLogManager())
job.setProgressListener(getEntranceContext.getOrCreatePersistenceManager())
@@ -130,7 +130,8 @@ abstract class EntranceServer extends Logging {
}
job.getId()
- }{t =>
+ } {
+ t =>
job.onFailure("Submitting the query failed!(提交查询失败!)", t)
val _jobRequest: JobRequest =
getEntranceContext.getOrCreateEntranceParser().parseToJobRequest(job)
getEntranceContext.getOrCreatePersistenceManager().createPersistenceEngine().updateIfNeeded(_jobRequest)
@@ -141,23 +142,8 @@ abstract class EntranceServer extends Logging {
new SubmitFailedException(30009, "Submitting the query
failed!(提交查询失败!)" + ExceptionUtils.getRootCauseMessage(t), t)
}
}
-
-
}
-// def killJobFromJobHistory(jobId: String): String = {
-// val rpcSender =
Sender.getSender(EntranceConfiguration.QUERY_PERSISTENCE_SPRING_APPLICATION_NAME.getValue)
-// val jobQueryRequest = new JobRequest
-// jobQueryRequest.setId(java.lang.Long.parseLong(jobId))
-// jobQueryRequest.setStatus(SchedulerEventState.Cancelled.toString)
-// val response =
rpcSender.ask(JobReqUpdate(jobQueryRequest)).asInstanceOf[JobRespProtocol]
-// response.getStatus match {
-// case 0 => "success"
-// case _ => response.getMsg
-// }
-// }
-
-
def logReader(execId: String): LogReader
def getJob(execId: String): Option[Job] =
getEntranceContext.getOrCreateScheduler().get(execId).map(_.asInstanceOf[Job])
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/log/ErrorCodeManager.scala
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/log/ErrorCodeManager.scala
index 27b7a9db9..9175f836c 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/log/ErrorCodeManager.scala
+++
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/log/ErrorCodeManager.scala
@@ -17,31 +17,18 @@
package org.apache.linkis.entrance.log
-import java.io.{BufferedReader, InputStreamReader}
-import java.util
-import java.util.concurrent.TimeUnit
-
-import org.apache.linkis.common.io.FsPath
-import org.apache.linkis.common.utils.{Logging, Utils}
-import org.apache.linkis.entrance.conf.EntranceConfiguration
import org.apache.linkis.errorcode.client.handler.LinkisErrorCodeHandler
-import org.apache.linkis.entrance.errorcode.EntranceErrorConstants
-import org.apache.linkis.storage.FSFactory
-import javax.annotation.PostConstruct
-
-import scala.collection.mutable.ArrayBuffer
-
abstract class ErrorCodeManager {
def getErrorCodes: Array[ErrorCode]
def errorMatch(log: String): Option[(String, String)] = {
- getErrorCodes.foreach(e => if(e.regex.findFirstIn(log).isDefined) {
+ getErrorCodes.foreach(e => if (e.regex.findFirstIn(log).isDefined) {
val matched = e.regex.unapplySeq(log)
- if(matched.nonEmpty)
+ if (matched.nonEmpty) {
return Some(e.code -> e.message.format(matched.get:_*))
- else Some(e.code -> e.message)
+ } else Some(e.code -> e.message)
})
None
}
@@ -60,66 +47,15 @@ object FlexibleErrorCodeManager extends ErrorCodeManager{
override def errorMatch(log: String): Option[(String, String)] = {
val errorCodes = errorCodeHandler.handle(log)
- if (errorCodes != null && errorCodes.size() > 0){
+ if (errorCodes != null && errorCodes.size() > 0) {
Some(errorCodes.get(0).getErrorCode, errorCodes.get(0).getErrorDesc)
- } else{
+ } else {
None
}
}
}
-
-
object Main{
def main(args: Array[String]): Unit = {
}
-}
-
-
-/**
- * RefreshableErrorCodeManager corresponds to FixedErrorCodeManager, and
refresheyeErrorCodeManager can update its own errorCodes through the query
module.
- * The purpose is to enable users to update the error code at any time by
modifying the database.
- * RefreshableErrorCodeManager 与 FixedErrorCodeManager
是对应的,refreshaleErrorCodeManager可以通过query模块进行更新自身的errorCodes
- * 目的是为了能够让用户通过修改数据库随时更新错误码
- */
-//
-//object RefreshableErrorCodeManager extends ErrorCodeManager{
-// private val sender:Sender =
-//
Sender.getSender(EntranceConfiguration.QUERY_PERSISTENCE_SPRING_APPLICATION_NAME.getValue,
1000 * 60 * 60, 100)
-//
-// private val logger:Logger = LoggerFactory.getLogger(getClass)
-// private var errorCodes:Array[ErrorCode] = _
-//
-// class FetchErrorCodeThread extends Runnable{
-// override def run(): Unit = {
-// val requestErrorCode = new RequestErrorCode
-// val responseErrorCode =
sender.send(requestErrorCode).asInstanceOf[ResponseErrorCode]
-// Utils.tryAndWarnMsg{
-// val responseErrorCode =
sender.send(requestErrorCode).asInstanceOf[ResponseErrorCode]
-// val status = responseErrorCode.getStatus
-// val message = responseErrorCode.getMessage
-// if (status != 0){
-// logger.warn(s"Error encounters when retrieve errorCodes from query
module, reason: $message")
-// }else{
-// val errorCodeList = responseErrorCode.getResult
-// val arrayBuffer = new ArrayBuffer[ErrorCode]()
-// import scala.collection.JavaConversions._
-// errorCodeList foreach { errorCode =>
-// val regex = errorCode.getErrorRegex.r.unanchored
-// val errorCode_ = errorCode.getErrorCode
-// val errorDesc = errorCode.getErrorDesc
-// arrayBuffer += ErrorCode(regex, errorCode_, errorDesc)
-// }
-// errorCodes = arrayBuffer.toArray
-// }
-// }("Query ErrorCodes failed. You may check the cause or just ignore it
")
-// }
-// }
-//
-// override def getErrorCodes: Array[ErrorCode] = errorCodes
-//}
-
-
-
-
-
+}
\ No newline at end of file
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/java/org/apache/linkis/gateway/springcloud/http/GatewayAuthorizationFilter.java
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/java/org/apache/linkis/gateway/springcloud/http/GatewayAuthorizationFilter.java
index 48950f779..b95435d1f 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/java/org/apache/linkis/gateway/springcloud/http/GatewayAuthorizationFilter.java
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/java/org/apache/linkis/gateway/springcloud/http/GatewayAuthorizationFilter.java
@@ -19,7 +19,6 @@ package org.apache.linkis.gateway.springcloud.http;
import org.apache.linkis.common.ServiceInstance;
import org.apache.linkis.common.conf.CommonVars;
-import org.apache.linkis.common.utils.JavaLog;
import org.apache.linkis.gateway.exception.GatewayWarnException;
import org.apache.linkis.gateway.http.BaseGatewayContext;
import org.apache.linkis.gateway.parser.GatewayParser;
@@ -52,11 +51,14 @@ import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.nio.charset.StandardCharsets;
import java.util.List;
-public class GatewayAuthorizationFilter extends JavaLog implements
GlobalFilter, Ordered {
+public class GatewayAuthorizationFilter implements GlobalFilter, Ordered {
+ private static final Logger logger =
LoggerFactory.getLogger(GatewayAuthorizationFilter.class);
private GatewayParser parser;
private GatewayRouter router;
@@ -134,30 +136,6 @@ public class GatewayAuthorizationFilter extends JavaLog
implements GlobalFilter,
.asyncPredicate(route.getPredicate())
.build();
}
- // @Override
- // public Mono<Void> filter(ServerWebExchange exchange,
GatewayFilterChain chain) {
- // AbstractServerHttpRequest request = (AbstractServerHttpRequest)
exchange.getRequest();
- // ServerHttpResponse response = exchange.getResponse();
- // Route route =
exchange.getAttribute(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR);
- // BaseGatewayContext gatewayContext =
getBaseGatewayContext(exchange, route);
- //
- // DataBufferFactory bufferFactory = response.bufferFactory();
- //
- //
if(((SpringCloudGatewayHttpRequest)gatewayContext.getRequest()).isRequestBodyAutowired())
{
- // ServerHttpRequestDecorator decorator = new
ServerHttpRequestDecorator(request) {
- // @Override
- // public Flux<DataBuffer> getBody() {
- //
if(StringUtils.isBlank(gatewayContext.getRequest().getRequestBody()))
- // return Flux.empty();
- // return
- //
Flux.just(bufferFactory.wrap(gatewayContext.getRequest().getRequestBody().getBytes(StandardCharsets.UTF_8)));
- // }
- // };
- // return
chain.filter(exchange.mutate().request(decorator).build());
- // } else {
- // return chain.filter(exchange);
- // }
- // }
private Mono<Void> gatewayDeal(
ServerWebExchange exchange,
@@ -186,7 +164,7 @@ public class GatewayAuthorizationFilter extends JavaLog
implements GlobalFilter,
}
serviceInstance = router.route(gatewayContext);
} catch (Throwable t) {
- warn("", t);
+ logger.warn("", t);
Message message =
Message.error(t).$less$less(gatewayContext.getRequest().getRequestURI());
if (!gatewayContext.isWebSocketRequest()) {
@@ -220,7 +198,7 @@ public class GatewayAuthorizationFilter extends JavaLog
implements GlobalFilter,
exchange.getRequest().getPath().value(),
"/" + realRd.getId() + "/",
"");
- info("Proxy to " + uri);
+ logger.info("Proxy to " + uri);
Route realRoute =
Route.async()
.id(route.getId())
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpRequest.scala
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpRequest.scala
index 79b4d68b7..6099a11d5 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpRequest.scala
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpRequest.scala
@@ -25,14 +25,14 @@ import javax.servlet.http.Cookie
import org.apache.commons.lang3.StringUtils
import org.springframework.http.server.reactive.AbstractServerHttpRequest
-import scala.collection.JavaConversions
+import scala.collection.JavaConverters._
class SpringCloudGatewayHttpRequest(request: AbstractServerHttpRequest)
extends GatewayHttpRequest {
private val headers = {
val headerEntrys = request.getHeaders
val header = new JMap[String, Array[String]]
- headerEntrys.foreach{case (key, value) => if(value != null &&
value.nonEmpty) header.put(key, value.toArray(new Array[String](value.size())))
+ headerEntrys.foreach{case (key, value) => if (value != null &&
value.nonEmpty) header.put(key, value.toArray(new Array[String](value.size())))
else header.put(key, Array.empty)
}
header
@@ -41,7 +41,7 @@ class SpringCloudGatewayHttpRequest(request:
AbstractServerHttpRequest) extends
private val queryParams = {
val querys = request.getQueryParams
val queryParams = new JMap[String, Array[String]]
- querys.foreach {case (key, value) => if(value != null && value.nonEmpty)
queryParams.put(key, value.toArray(new Array[String](value.size())))
+ querys.foreach {case (key, value) => if (value != null && value.nonEmpty)
queryParams.put(key, value.toArray(new Array[String](value.size())))
else queryParams.put(key, Array.empty)
}
queryParams
@@ -50,7 +50,7 @@ class SpringCloudGatewayHttpRequest(request:
AbstractServerHttpRequest) extends
private val cookies = {
val cookieMap = request.getCookies
val cookies = new JMap[String, Array[Cookie]]
- cookieMap.foreach {case (key, value) => if(value != null &&
value.nonEmpty) cookies.put(key, value.map(c => new Cookie(c.getName,
c.getValue)).toArray)
+ cookieMap.foreach {case (key, value) => if (value != null &&
value.nonEmpty) cookies.put(key, value.map(c => new Cookie(c.getName,
c.getValue)).toArray)
else cookies.put(key, Array.empty)}
cookies
}
@@ -63,16 +63,16 @@ class SpringCloudGatewayHttpRequest(request:
AbstractServerHttpRequest) extends
def setRequestURI(requestURI: String): Unit = this.requestURI = requestURI
- def getRequest = request
+ def getRequest: AbstractServerHttpRequest = request
- override def getRequestURI: String = if(StringUtils.isNotBlank(requestURI))
requestURI else request.getPath.pathWithinApplication.value
+ override def getRequestURI: String = if (StringUtils.isNotBlank(requestURI))
requestURI else request.getPath.pathWithinApplication.value
- override def getURI: URI = if(StringUtils.isNotBlank(requestURI)) new
URI(requestURI) else request.getURI
+ override def getURI: URI = if (StringUtils.isNotBlank(requestURI)) new
URI(requestURI) else request.getURI
override def getHeaders: JMap[String, Array[String]] = headers
override def addHeader(headerName: String, headers: Array[String]): Unit =
- request.getHeaders.addAll(headerName,
JavaConversions.seqAsJavaList(headers.toList))
+ request.getHeaders.addAll(headerName, headers.toList.asJava)
override def addCookie(cookieName: String, cookies: Array[Cookie]): Unit = {
this.cookies.put(cookieName, cookies)
@@ -80,18 +80,6 @@ class SpringCloudGatewayHttpRequest(request:
AbstractServerHttpRequest) extends
}
def getAddCookies: JMap[String, Array[Cookie]] = addCookies
-// override def addCookie(cookieName: String, cookies: Array[Cookie]): Unit =
request.getNativeRequest[Any] match {
-// case httpInfos: HttpInfos =>
-// httpInfos.cookies().put(cookieName,
JavaConversions.setAsJavaSet(cookies.map { c =>
-// val cookie = new DefaultCookie(c.getName, c.getValue)
-// cookie.setDomain(c.getDomain)
-// cookie.setMaxAge(c.getMaxAge)
-// cookie.setPath(c.getPath)
-// cookie.setSecure(c.getSecure)
-// cookie
-// }.toSet))
-// case _ => throw new GatewayErrorException(10040, "Not support method:
addCookie in GatewayHttpRequest.")
-// }
override def getQueryParams: JMap[String, Array[String]] = queryParams
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpResponse.scala
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpResponse.scala
index 59d563da6..de393fec6 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpResponse.scala
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/http/SpringCloudGatewayHttpResponse.scala
@@ -52,11 +52,12 @@ class SpringCloudGatewayHttpResponse(response:
ServerHttpResponse) extends Gatew
override def write(message: String): Unit =
cachedHTTPResponseMsg.append(message)
- override def sendResponse(): Unit = if(responseMono == null) synchronized {
- if(responseMono != null) return
- if(cachedRedirectUrlMsg.nonEmpty) {
- if(response.getStatusCode == null || (response.getStatusCode != null &&
!response.getStatusCode.is3xxRedirection()))
+ override def sendResponse(): Unit = if (responseMono == null) synchronized {
+ if (responseMono != null) return
+ if (cachedRedirectUrlMsg.nonEmpty) {
+ if (response.getStatusCode == null || (response.getStatusCode != null &&
!response.getStatusCode.is3xxRedirection())) {
response.setStatusCode(HttpStatus.TEMPORARY_REDIRECT)
+ }
response.getHeaders.set("Location", cachedRedirectUrlMsg.toString)
responseMono = response.setComplete()
return
@@ -66,7 +67,7 @@ class SpringCloudGatewayHttpResponse(response:
ServerHttpResponse) extends Gatew
val dataBuffer =
response.bufferFactory().wrap(cachedHTTPResponseMsg.toString.getBytes(Configuration.BDP_ENCODING.getValue))
val messageFlux = Flux.just(Array(dataBuffer): _*)
responseMono = response.writeWith(messageFlux)
- } else if(cachedWebSocketResponseMsg.nonEmpty) {
+ } else if (cachedWebSocketResponseMsg.nonEmpty) {
response match {
case abstractResponse: AbstractServerHttpResponse =>
val nativeResponse =
abstractResponse.getNativeResponse.asInstanceOf[HttpServerResponse]
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/websocket/SpringCloudGatewayWebsocketUtils.scala
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/websocket/SpringCloudGatewayWebsocketUtils.scala
index f4060d836..8e654c6d9 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/websocket/SpringCloudGatewayWebsocketUtils.scala
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-spring-cloud-gateway/src/main/scala/org/apache/linkis/gateway/springcloud/websocket/SpringCloudGatewayWebsocketUtils.scala
@@ -37,11 +37,7 @@ import reactor.core.publisher.{Flux, Mono}
import scala.collection.JavaConversions._
-object SpringCloudGatewayWebsocketUtils extends Logging
{//(websocketRoutingFilter: WebsocketRoutingFilter,
-// webSocketClient: WebSocketClient,
-// webSocketService: WebSocketService,
-// loadBalancer: LoadBalancerClient,
-// parser: GatewayParser, router:
GatewayRouter) extends GlobalFilter with Ordered{
+object SpringCloudGatewayWebsocketUtils extends Logging {
val SPRING_CLOUD_GATEWAY_WEBSOCKET_HEARTBEAT =
CommonVars("wds.linkis.gateway.websocket.heartbeat", new
TimeType("5s")).getValue.toLong
@@ -93,7 +89,7 @@ object SpringCloudGatewayWebsocketUtils extends Logging
{//(websocketRoutingFilt
def getGatewayWebSocketSessionConnection(user: String, webSocketSession:
WebSocketSession): GatewayWebSocketSessionConnection = {
val key = getWebSocketSessionKey(webSocketSession)
if(!cachedWebSocketSessions.containsKey(key)) cachedWebSocketSessions
synchronized {
- if(!cachedWebSocketSessions.containsKey(key)) {
+ if (!cachedWebSocketSessions.containsKey(key)) {
logger.info(s"receive a new webSocket connection $key from DWC-UI for
user $user.")
cachedWebSocketSessions.put(key, new
GatewayWebSocketSessionConnection(webSocketSession, user))
}
@@ -137,6 +133,6 @@ object SpringCloudGatewayWebsocketUtils extends Logging
{//(websocketRoutingFilt
def sendMsg(exchange: ServerWebExchange, webSocketSession: WebSocketSession,
webSocketMessage: WebSocketMessage): Mono[Void] =
- webSocketSession.send(Flux.just(Array(webSocketMessage.retain()):_*))
+ webSocketSession.send(Flux.just(Array(webSocketMessage.retain()): _*))
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]