Skip to content

Commit

Permalink
Refactor MetaDataManagerPersistService's impl (#34405)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Jan 19, 2025
1 parent 9634a25 commit 5fd5c17
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5fd5c17

Please sign in to comment.