From f699b6265021ea88ad519d08456c3302a38e1709 Mon Sep 17 00:00:00 2001
From: zhangliang <zhangliang@apache.org>
Date: Sun, 29 Dec 2024 20:08:56 +0800
Subject: [PATCH] Refactor MetaDataChangedSubscriber

---
 .../subscriber/type/MetaDataChangedSubscriber.java     | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/MetaDataChangedSubscriber.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/MetaDataChangedSubscriber.java
index ed75eb960b90f..936ff6d05cf3d 100644
--- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/MetaDataChangedSubscriber.java
+++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/subscriber/type/MetaDataChangedSubscriber.java
@@ -19,6 +19,7 @@
 
 import com.google.common.base.Preconditions;
 import com.google.common.eventbus.Subscribe;
+import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceType;
 import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable;
 import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereView;
@@ -31,22 +32,15 @@
 import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.event.metadata.schema.view.ViewDroppedEvent;
 import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.DispatchEventSubscriber;
 import org.apache.shardingsphere.mode.metadata.refresher.ShardingSphereStatisticsRefreshEngine;
-import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
 
 /**
  * Meta data changed subscriber.
  */
+@RequiredArgsConstructor
 public final class MetaDataChangedSubscriber implements DispatchEventSubscriber {
     
     private final ContextManager contextManager;
     
-    private final ClusterPersistRepository repository;
-    
-    public MetaDataChangedSubscriber(final ContextManager contextManager) {
-        this.contextManager = contextManager;
-        repository = (ClusterPersistRepository) contextManager.getPersistServiceFacade().getRepository();
-    }
-    
     /**
      * Renew to added schema.
      *