diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/service/PersistServiceFacade.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/service/PersistServiceFacade.java index d83359fc7bd20..3c63b6d4391f4 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/service/PersistServiceFacade.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/service/PersistServiceFacade.java @@ -52,7 +52,7 @@ public PersistServiceFacade(final PersistRepository repository, final ModeConfig statePersistService = new StatePersistService(repository); PersistServiceBuilder persistServiceBuilder = TypedSPILoader.getService(PersistServiceBuilder.class, modeConfiguration.getType()); metaDataManagerPersistService = persistServiceBuilder.buildMetaDataManagerPersistService(contextManager); - processPersistService = persistServiceBuilder.buildProcessPersistService(contextManager); + processPersistService = persistServiceBuilder.buildProcessPersistService(repository); } /** diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/service/persist/PersistServiceBuilder.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/service/persist/PersistServiceBuilder.java index b7a69d47da57b..53abde32c4c17 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/service/persist/PersistServiceBuilder.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/service/persist/PersistServiceBuilder.java @@ -19,6 +19,7 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import org.apache.shardingsphere.mode.manager.ContextManager; +import org.apache.shardingsphere.mode.spi.PersistRepository; /** * Persist service builder. @@ -36,8 +37,8 @@ public interface PersistServiceBuilder extends TypedSPI { /** * Build process persist service. * - * @param contextManager context manager + * @param repository persist repository * @return process persist service */ - ProcessPersistService buildProcessPersistService(ContextManager contextManager); + ProcessPersistService buildProcessPersistService(PersistRepository repository); } diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistServiceBuilderFixture.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistServiceBuilderFixture.java index b944de70f5f66..a400e9718e543 100644 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistServiceBuilderFixture.java +++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/fixture/PersistServiceBuilderFixture.java @@ -21,6 +21,7 @@ import org.apache.shardingsphere.mode.service.persist.MetaDataManagerPersistService; import org.apache.shardingsphere.mode.service.persist.PersistServiceBuilder; import org.apache.shardingsphere.mode.service.persist.ProcessPersistService; +import org.apache.shardingsphere.mode.spi.PersistRepository; public final class PersistServiceBuilderFixture implements PersistServiceBuilder { @@ -30,7 +31,7 @@ public MetaDataManagerPersistService buildMetaDataManagerPersistService(final Co } @Override - public ProcessPersistService buildProcessPersistService(final ContextManager contextManager) { + public ProcessPersistService buildProcessPersistService(final PersistRepository repository) { return null; } diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/service/ClusterPersistServiceBuilder.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/service/ClusterPersistServiceBuilder.java index 1a27f072b9ef1..dc06995b15e6b 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/service/ClusterPersistServiceBuilder.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/service/ClusterPersistServiceBuilder.java @@ -21,6 +21,7 @@ import org.apache.shardingsphere.mode.service.persist.MetaDataManagerPersistService; import org.apache.shardingsphere.mode.service.persist.PersistServiceBuilder; import org.apache.shardingsphere.mode.service.persist.ProcessPersistService; +import org.apache.shardingsphere.mode.spi.PersistRepository; /** * Cluster persist service builder. @@ -33,8 +34,8 @@ public MetaDataManagerPersistService buildMetaDataManagerPersistService(final Co } @Override - public ProcessPersistService buildProcessPersistService(final ContextManager contextManager) { - return new ClusterProcessPersistService(contextManager.getRepository()); + public ProcessPersistService buildProcessPersistService(final PersistRepository repository) { + return new ClusterProcessPersistService(repository); } @Override diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandalonePersistServiceBuilder.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandalonePersistServiceBuilder.java index b77fbe2f49f55..1e7e2efff1236 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandalonePersistServiceBuilder.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/service/StandalonePersistServiceBuilder.java @@ -21,6 +21,7 @@ import org.apache.shardingsphere.mode.service.persist.MetaDataManagerPersistService; import org.apache.shardingsphere.mode.service.persist.PersistServiceBuilder; import org.apache.shardingsphere.mode.service.persist.ProcessPersistService; +import org.apache.shardingsphere.mode.spi.PersistRepository; /** * Standalone meta data manager persist service builder. @@ -33,7 +34,7 @@ public MetaDataManagerPersistService buildMetaDataManagerPersistService(final Co } @Override - public ProcessPersistService buildProcessPersistService(final ContextManager contextManager) { + public ProcessPersistService buildProcessPersistService(final PersistRepository repository) { return new StandaloneProcessPersistService(); }