This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new cc94e119f2b [chore](build) remove aspectj (#54498)
cc94e119f2b is described below
commit cc94e119f2b785df5b651185ab8b8322aaa0628c
Author: morrySnow <[email protected]>
AuthorDate: Fri Aug 15 11:55:46 2025 +0800
[chore](build) remove aspectj (#54498)
### What problem does this PR solve?
Related PR: #17797
Problem Summary:
because it slow down compilation and only used in very limited places
---
fe/fe-common/pom.xml | 8 --
.../doris/common/annotation/LogException.java | 29 -------
.../doris/common/annotation/NoException.java | 29 -------
fe/fe-core/pom.xml | 24 ------
.../org/apache/doris/aspectj/ExceptionAspect.java | 51 -----------
.../org/apache/doris/load/loadv2/BulkLoadJob.java | 23 ++---
.../apache/doris/load/loadv2/InsertLoadJob.java | 18 ++--
.../apache/doris/service/FrontendServiceImpl.java | 99 +++++++++++-----------
fe/pom.xml | 11 ---
9 files changed, 77 insertions(+), 215 deletions(-)
diff --git a/fe/fe-common/pom.xml b/fe/fe-common/pom.xml
index 85aa3b1aee5..59459d1cae1 100644
--- a/fe/fe-common/pom.xml
+++ b/fe/fe-common/pom.xml
@@ -90,14 +90,6 @@ under the License.
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
diff --git
a/fe/fe-common/src/main/java/org/apache/doris/common/annotation/LogException.java
b/fe/fe-common/src/main/java/org/apache/doris/common/annotation/LogException.java
deleted file mode 100644
index a1ad578ee76..00000000000
---
a/fe/fe-common/src/main/java/org/apache/doris/common/annotation/LogException.java
+++ /dev/null
@@ -1,29 +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.doris.common.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-// You can use this annotation when you want add try catch logger error.
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface LogException {
-}
diff --git
a/fe/fe-common/src/main/java/org/apache/doris/common/annotation/NoException.java
b/fe/fe-common/src/main/java/org/apache/doris/common/annotation/NoException.java
deleted file mode 100644
index 6add77cd4ea..00000000000
---
a/fe/fe-common/src/main/java/org/apache/doris/common/annotation/NoException.java
+++ /dev/null
@@ -1,29 +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.doris.common.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-// You can use this annotation when throw exception the program will exit.
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface NoException {
-}
diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml
index cf77a43e286..9ffa6447bb0 100644
--- a/fe/fe-core/pom.xml
+++ b/fe/fe-core/pom.xml
@@ -946,30 +946,6 @@ under the License.
</resource>
</resources>
<plugins>
- <!--aspectj-->
- <plugin>
- <groupId>dev.aspectj</groupId>
- <artifactId>aspectj-maven-plugin</artifactId>
- <version>1.13.1</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <forceAjcCompile>true</forceAjcCompile>
- <sources/>
- <weaveDirectories>
-
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
- </weaveDirectories>
- <source>${maven.compiler.source}</source>
- <target>${maven.compiler.target}</target>
- <complianceLevel>${maven.compiler.target}</complianceLevel>
- </configuration>
- </plugin>
<!--jcup-->
<plugin>
<groupId>net.sourceforge.czt.dev</groupId>
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/aspectj/ExceptionAspect.java
b/fe/fe-core/src/main/java/org/apache/doris/aspectj/ExceptionAspect.java
deleted file mode 100644
index 573ad2f6c5e..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/aspectj/ExceptionAspect.java
+++ /dev/null
@@ -1,51 +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.doris.aspectj;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-
-@Aspect
-public class ExceptionAspect {
-
- private static final Logger LOG =
LogManager.getLogger(ExceptionAspect.class);
-
- @Pointcut("@annotation(org.apache.doris.common.annotation.LogException)")
- public void exceptionLogPointCut() {
- }
-
- @AfterThrowing(value = "exceptionLogPointCut()", throwing = "e")
- public void logException(Throwable e) {
- LOG.warn(e);
- }
-
- @Pointcut("@annotation(org.apache.doris.common.annotation.NoException)")
- public void exitPointCut() {
- }
-
- @AfterThrowing(value = "exitPointCut()", throwing = "e")
- public void exitException(Throwable e) {
- LOG.warn("A problem that does not allow errors has occurred.");
- LOG.warn(e);
- System.exit(-1);
- }
-
-}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
index 3667794d139..53c201fcea4 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
@@ -29,7 +29,6 @@ import org.apache.doris.catalog.Table;
import org.apache.doris.catalog.TableIf;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.MetaNotFoundException;
-import org.apache.doris.common.annotation.LogException;
import org.apache.doris.common.util.LogBuilder;
import org.apache.doris.common.util.LogKey;
import org.apache.doris.load.BrokerFileGroup;
@@ -243,18 +242,22 @@ public abstract class BulkLoadJob extends LoadJob
implements GsonPostProcessable
.collect(Collectors.toSet());
}
- @LogException
@Override
public Set<String> getTableNames() throws MetaNotFoundException {
- Set<String> result = Sets.newHashSet();
- Database database =
Env.getCurrentInternalCatalog().getDbOrMetaException(dbId);
- // The database will not be locked in here.
- // The getTable is a thread-safe method called without read lock of
database
- for (long tableId : fileGroupAggInfo.getAllTableIds()) {
- Table table = database.getTableOrMetaException(tableId);
- result.add(table.getName());
+ try {
+ Set<String> result = Sets.newHashSet();
+ Database database =
Env.getCurrentInternalCatalog().getDbOrMetaException(dbId);
+ // The database will not be locked in here.
+ // The getTable is a thread-safe method called without read lock
of database
+ for (long tableId : fileGroupAggInfo.getAllTableIds()) {
+ Table table = database.getTableOrMetaException(tableId);
+ result.add(table.getName());
+ }
+ return result;
+ } catch (Exception e) {
+ LOG.warn(e);
+ throw e;
}
- return result;
}
@Override
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/InsertLoadJob.java
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/InsertLoadJob.java
index dff0a07129e..9a23c1f9c72 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/InsertLoadJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/InsertLoadJob.java
@@ -24,7 +24,6 @@ import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.Table;
import org.apache.doris.catalog.TableIf;
import org.apache.doris.common.MetaNotFoundException;
-import org.apache.doris.common.annotation.LogException;
import org.apache.doris.load.EtlJobType;
import org.apache.doris.load.FailMsg;
import org.apache.doris.load.FailMsg.CancelType;
@@ -32,6 +31,8 @@ import org.apache.doris.load.FailMsg.CancelType;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import com.google.gson.annotations.SerializedName;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import java.util.Set;
@@ -41,6 +42,9 @@ import java.util.Set;
* The state of insert load job is always finished, so it will never be
scheduled by JobScheduler.
*/
public class InsertLoadJob extends LoadJob {
+
+ private static final Logger LOG =
LogManager.getLogger(InsertLoadJob.class);
+
@SerializedName("tid")
private long tableId;
@@ -105,11 +109,15 @@ public class InsertLoadJob extends LoadJob {
return Sets.newHashSet(name);
}
- @LogException
@Override
public Set<String> getTableNames() throws MetaNotFoundException {
- Database database =
Env.getCurrentInternalCatalog().getDbOrMetaException(dbId);
- Table table = database.getTableOrMetaException(tableId);
- return Sets.newHashSet(table.getName());
+ try {
+ Database database =
Env.getCurrentInternalCatalog().getDbOrMetaException(dbId);
+ Table table = database.getTableOrMetaException(tableId);
+ return Sets.newHashSet(table.getName());
+ } catch (Exception e) {
+ LOG.warn(e);
+ throw e;
+ }
}
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 4421e9c75ab..ad29d1f6a0c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -75,7 +75,6 @@ import org.apache.doris.common.ThriftServerContext;
import org.apache.doris.common.ThriftServerEventProcessor;
import org.apache.doris.common.UserException;
import org.apache.doris.common.Version;
-import org.apache.doris.common.annotation.LogException;
import org.apache.doris.common.util.DebugPointUtil;
import org.apache.doris.common.util.Util;
import org.apache.doris.cooldown.CooldownDelete;
@@ -544,62 +543,66 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
return db;
}
- @LogException
@Override
public TGetTablesResult getTableNames(TGetTablesParams params) throws
TException {
- if (LOG.isDebugEnabled()) {
- LOG.debug("get table name request: {}", params);
- }
- TGetTablesResult result = new TGetTablesResult();
- List<String> tablesResult = Lists.newArrayList();
- result.setTables(tablesResult);
- PatternMatcher matcher = null;
- if (params.isSetPattern()) {
- try {
- matcher =
PatternMatcher.createMysqlPattern(params.getPattern(),
- CaseSensibility.TABLE.getCaseSensibility());
- } catch (PatternMatcherException e) {
- throw new TException("Pattern is in bad format: " +
params.getPattern());
+ try {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("get table name request: {}", params);
+ }
+ TGetTablesResult result = new TGetTablesResult();
+ List<String> tablesResult = Lists.newArrayList();
+ result.setTables(tablesResult);
+ PatternMatcher matcher = null;
+ if (params.isSetPattern()) {
+ try {
+ matcher =
PatternMatcher.createMysqlPattern(params.getPattern(),
+ CaseSensibility.TABLE.getCaseSensibility());
+ } catch (PatternMatcherException e) {
+ throw new TException("Pattern is in bad format: " +
params.getPattern());
+ }
}
- }
- // database privs should be checked in analysis phrase
- UserIdentity currentUser;
- if (params.isSetCurrentUserIdent()) {
- currentUser = UserIdentity.fromThrift(params.current_user_ident);
- } else {
- currentUser =
UserIdentity.createAnalyzedUserIdentWithIp(params.user, params.user_ip);
- }
- String catalogName = Strings.isNullOrEmpty(params.catalog) ?
InternalCatalog.INTERNAL_CATALOG_NAME
- : params.catalog;
- String dbName = getDbNameFromMysqlTableSchema(catalogName, params.db);
- DatabaseIf<TableIf> db = Env.getCurrentEnv().getCatalogMgr()
- .getCatalogOrException(catalogName, catalog -> new
TException("Unknown catalog: " + catalog))
- .getDbNullable(dbName);
+ // database privs should be checked in analysis phrase
+ UserIdentity currentUser;
+ if (params.isSetCurrentUserIdent()) {
+ currentUser =
UserIdentity.fromThrift(params.current_user_ident);
+ } else {
+ currentUser =
UserIdentity.createAnalyzedUserIdentWithIp(params.user, params.user_ip);
+ }
+ String catalogName = Strings.isNullOrEmpty(params.catalog) ?
InternalCatalog.INTERNAL_CATALOG_NAME
+ : params.catalog;
+ String dbName = getDbNameFromMysqlTableSchema(catalogName,
params.db);
+ DatabaseIf<TableIf> db = Env.getCurrentEnv().getCatalogMgr()
+ .getCatalogOrException(catalogName, catalog -> new
TException("Unknown catalog: " + catalog))
+ .getDbNullable(dbName);
- if (db != null) {
- Set<String> tableNames;
- try {
- tableNames = db.getTableNamesOrEmptyWithLock();
- for (String tableName : tableNames) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("get table: {}, wait to check", tableName);
- }
- if (!Env.getCurrentEnv().getAccessManager()
- .checkTblPriv(currentUser, catalogName, dbName,
tableName,
- PrivPredicate.SHOW)) {
- continue;
- }
- if (matcher != null && !matcher.match(tableName)) {
- continue;
+ if (db != null) {
+ Set<String> tableNames;
+ try {
+ tableNames = db.getTableNamesOrEmptyWithLock();
+ for (String tableName : tableNames) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("get table: {}, wait to check",
tableName);
+ }
+ if (!Env.getCurrentEnv().getAccessManager()
+ .checkTblPriv(currentUser, catalogName,
dbName, tableName,
+ PrivPredicate.SHOW)) {
+ continue;
+ }
+ if (matcher != null && !matcher.match(tableName)) {
+ continue;
+ }
+ tablesResult.add(tableName);
}
- tablesResult.add(tableName);
+ } catch (Exception e) {
+ LOG.warn("failed to get table names for db {} in catalog
{}", params.db, catalogName, e);
}
- } catch (Exception e) {
- LOG.warn("failed to get table names for db {} in catalog {}",
params.db, catalogName, e);
}
+ return result;
+ } catch (Throwable e) {
+ LOG.warn(e);
+ throw e;
}
- return result;
}
@Override
diff --git a/fe/pom.xml b/fe/pom.xml
index b2df6f18091..ee4fdbbb35f 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -242,7 +242,6 @@ under the License.
<skip.plugin>false</skip.plugin>
<sonar.organization>apache</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
- <aspectj.version>1.9.7</aspectj.version>
<cglib.version>2.2</cglib.version>
<commons-cli.version>1.4</commons-cli.version>
<commons-filerupload.version>1.5</commons-filerupload.version>
@@ -1349,16 +1348,6 @@ under the License.
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
<!--
https://mvnrepository.com/artifact/org.apache.hudi/hudi-hadoop-mr -->
<dependency>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]