Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -315,6 +316,7 @@ public void doCommit() {
throw t;
} finally {
hmsCommitter.runClearPathsForFinish();
hmsCommitter.shutdownExecutorService();
}
}

Expand Down Expand Up @@ -1110,7 +1112,7 @@ class HmsCommitter {

// update statistics for unPartitioned table or existed partition
private final List<UpdateStatisticsTask> updateStatisticsTasks = new ArrayList<>();
Executor updateStatisticsExecutor = Executors.newFixedThreadPool(16);
ExecutorService updateStatisticsExecutor = Executors.newFixedThreadPool(16);

// add new partition
private final AddPartitionsTask addPartitionsTask = new AddPartitionsTask();
Expand Down Expand Up @@ -1529,6 +1531,10 @@ public void rollback() {
MoreFutures.getFutureValue(future, RuntimeException.class);
}
}

public void shutdownExecutorService() {
updateStatisticsExecutor.shutdownNow();
}
}

public Status wrapperRenameDirWithProfileSummary(String origFilePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand All @@ -731,7 +731,7 @@ public void dropPartition(String dbName, String tableName, List<String> 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);
}
}
}