4747import org .apache .fluss .server .zk .data .TableAssignment ;
4848import org .apache .fluss .server .zk .data .TableRegistration ;
4949import org .apache .fluss .shaded .zookeeper3 .org .apache .zookeeper .KeeperException ;
50- import org .apache .fluss .utils .concurrent .Executors ;
5150import org .apache .fluss .utils .function .RunnableWithException ;
5251import org .apache .fluss .utils .function .ThrowingRunnable ;
5352
6160import java .util .Optional ;
6261import java .util .Set ;
6362import java .util .concurrent .Callable ;
64- import java .util .concurrent .Executor ;
6563
6664import static org .apache .fluss .server .utils .TableDescriptorValidation .validateTableDescriptor ;
6765
@@ -75,26 +73,17 @@ public class MetadataManager {
7573 private final int maxPartitionNum ;
7674 private final int maxBucketNum ;
7775
78- private final Executor ioExecutor ;
79-
80- public MetadataManager (ZooKeeperClient zookeeperClient , Configuration conf ) {
81- this (zookeeperClient , conf , Executors .directExecutor ());
82- }
83-
8476 /**
8577 * Creates a new metadata manager.
8678 *
8779 * @param zookeeperClient the zookeeper client
8880 * @param conf the cluster configuration
89- * @param ioExecutor the io executor
9081 */
91- public MetadataManager (
92- ZooKeeperClient zookeeperClient , Configuration conf , Executor ioExecutor ) {
82+ public MetadataManager (ZooKeeperClient zookeeperClient , Configuration conf ) {
9383 this .zookeeperClient = zookeeperClient ;
9484 this .defaultTableLakeOptions = LakeStorageUtils .generateDefaultTableLakeOptions (conf );
9585 this .maxPartitionNum = conf .get (ConfigOptions .MAX_PARTITION_NUM );
9686 this .maxBucketNum = conf .get (ConfigOptions .MAX_BUCKET_NUM );
97- this .ioExecutor = ioExecutor ;
9887 }
9988
10089 public void createDatabase (
@@ -243,18 +232,13 @@ public void completeDeleteTable(long tableId) {
243232 String .format ("Delete tablet assignment meta fail for table %s." , tableId ));
244233 }
245234
246- public void completeDeletePartition (TablePartition tablePartition ) {
235+ public void completeDeletePartition (long partitionId ) {
247236 // final step for delete a partition.
248237 // delete partition assignments node, which will also delete the bucket state node,
249238 // so that all the zk nodes related to this partition are deleted.
250- ioExecutor .execute (
251- () -> {
252- try {
253- zookeeperClient .deletePartitionAssignment (tablePartition .getPartitionId ());
254- } catch (Exception e ) {
255- LOG .error ("Fail to complete partition {} deletion." , tablePartition , e );
256- }
257- });
239+ rethrowIfIsNotNoNodeException (
240+ () -> zookeeperClient .deletePartitionAssignment (partitionId ),
241+ String .format ("Delete tablet assignment meta fail for partition %s." , partitionId ));
258242 }
259243
260244 /**
0 commit comments