diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/builder/ClusterPersistServiceBuilder.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/builder/ClusterPersistServiceBuilder.java index 3d58e5fc1208f..ac0cd1c4daf6e 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/builder/ClusterPersistServiceBuilder.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/builder/ClusterPersistServiceBuilder.java @@ -32,7 +32,7 @@ public final class ClusterPersistServiceBuilder implements PersistServiceBuilder @Override public MetaDataManagerPersistService buildMetaDataManagerPersistService(final PersistRepository repository, final MetaDataContextManager metaDataContextManager) { - return new ClusterMetaDataManagerPersistService(repository, metaDataContextManager); + return new ClusterMetaDataManagerPersistService(metaDataContextManager, repository); } @Override diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistService.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistService.java index 50dcedea8f057..7727d460e9038 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistService.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistService.java @@ -57,16 +57,16 @@ */ public final class ClusterMetaDataManagerPersistService implements MetaDataManagerPersistService { + private final MetaDataContextManager metaDataContextManager; + private final MetaDataPersistService metaDataPersistService; private final ListenerAssistedPersistService listenerAssistedPersistService; - private final MetaDataContextManager metaDataContextManager; - - public ClusterMetaDataManagerPersistService(final PersistRepository repository, final MetaDataContextManager metaDataContextManager) { + public ClusterMetaDataManagerPersistService(final MetaDataContextManager metaDataContextManager, final PersistRepository repository) { + this.metaDataContextManager = metaDataContextManager; metaDataPersistService = metaDataContextManager.getMetaDataPersistService(); listenerAssistedPersistService = new ListenerAssistedPersistService(repository); - this.metaDataContextManager = metaDataContextManager; } @Override diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistServiceTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistServiceTest.java index e8e9aff1b9223..fe73c3816925e 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistServiceTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/ClusterMetaDataManagerPersistServiceTest.java @@ -70,7 +70,7 @@ class ClusterMetaDataManagerPersistServiceTest { @SneakyThrows(ReflectiveOperationException.class) @BeforeEach void setUp() { - metaDataManagerPersistService = new ClusterMetaDataManagerPersistService(mock(PersistRepository.class), metaDataContextManager); + metaDataManagerPersistService = new ClusterMetaDataManagerPersistService(metaDataContextManager, mock(PersistRepository.class)); Plugins.getMemberAccessor().set(ClusterMetaDataManagerPersistService.class.getDeclaredField("metaDataPersistService"), metaDataManagerPersistService, metaDataPersistService); Plugins.getMemberAccessor().set(ClusterMetaDataManagerPersistService.class.getDeclaredField("listenerAssistedPersistService"), metaDataManagerPersistService, listenerAssistedPersistService); } diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistService.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistService.java index 263266ccfa0bc..7c40216e24167 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistService.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistService.java @@ -62,10 +62,10 @@ */ public final class StandaloneMetaDataManagerPersistService implements MetaDataManagerPersistService { - private final MetaDataPersistService metaDataPersistService; - private final MetaDataContextManager metaDataContextManager; + private final MetaDataPersistService metaDataPersistService; + private final RuleItemChangedBuilder ruleItemChangedBuilder; public StandaloneMetaDataManagerPersistService(final MetaDataContextManager metaDataContextManager) {