From 7003cb012f35ec135e17d255ac7ce55a06953b39 Mon Sep 17 00:00:00 2001 From: wuwenchi Date: Wed, 3 Jul 2024 23:11:57 +0800 Subject: [PATCH] fix --- .../org/apache/doris/datasource/hive/HMSTransaction.java | 8 +++++++- .../doris/datasource/hive/ThriftHMSCachedClient.java | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java index bd0d2315c1e4a8..1d54dcb3cf47f2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java @@ -73,6 +73,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -315,6 +316,7 @@ public void doCommit() { throw t; } finally { hmsCommitter.runClearPathsForFinish(); + hmsCommitter.shutdownExecutorService(); } } @@ -1110,7 +1112,7 @@ class HmsCommitter { // update statistics for unPartitioned table or existed partition private final List updateStatisticsTasks = new ArrayList<>(); - Executor updateStatisticsExecutor = Executors.newFixedThreadPool(16); + ExecutorService updateStatisticsExecutor = Executors.newFixedThreadPool(16); // add new partition private final AddPartitionsTask addPartitionsTask = new AddPartitionsTask(); @@ -1529,6 +1531,10 @@ public void rollback() { MoreFutures.getFutureValue(future, RuntimeException.class); } } + + public void shutdownExecutorService() { + updateStatisticsExecutor.shutdownNow(); + } } public Status wrapperRenameDirWithProfileSummary(String origFilePath, diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/ThriftHMSCachedClient.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/ThriftHMSCachedClient.java index bc4da6762caaef..17fbcb09b029eb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/ThriftHMSCachedClient.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/ThriftHMSCachedClient.java @@ -682,7 +682,7 @@ public void updateTableStatistics( newTable.setParameters(newParams); client.client.alter_table(dbName, tableName, newTable); } catch (Exception e) { - throw new RuntimeException("failed to update table statistics for " + dbName + "." + tableName); + throw new RuntimeException("failed to update table statistics for " + dbName + "." + tableName, e); } } @@ -710,7 +710,7 @@ public void updatePartitionStatistics( modifiedPartition.setParameters(newParams); client.client.alter_partition(dbName, tableName, modifiedPartition); } catch (Exception e) { - throw new RuntimeException("failed to update table statistics for " + dbName + "." + tableName); + throw new RuntimeException("failed to update table statistics for " + dbName + "." + tableName, e); } } @@ -731,7 +731,7 @@ public void dropPartition(String dbName, String tableName, List partitio try (ThriftHMSClient client = getClient()) { client.client.dropPartition(dbName, tableName, partitionValues, deleteData); } catch (Exception e) { - throw new RuntimeException("failed to drop partition for " + dbName + "." + tableName); + throw new RuntimeException("failed to drop partition for " + dbName + "." + tableName, e); } } }