Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PersistServiceBuilder #31420

Merged
merged 1 commit into from
May 28, 2024
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 @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -30,7 +31,7 @@ public MetaDataManagerPersistService buildMetaDataManagerPersistService(final Co
}

@Override
public ProcessPersistService buildProcessPersistService(final ContextManager contextManager) {
public ProcessPersistService buildProcessPersistService(final PersistRepository repository) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
}

Expand Down
Loading