diff --git a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/cluster/ReadwriteSplittingQualifiedDataSourceDeletedSubscriber.java b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/cluster/ReadwriteSplittingQualifiedDataSourceDeletedSubscriber.java index fe4d4b95f878e..c24ee7f195e85 100644 --- a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/cluster/ReadwriteSplittingQualifiedDataSourceDeletedSubscriber.java +++ b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/cluster/ReadwriteSplittingQualifiedDataSourceDeletedSubscriber.java @@ -19,7 +19,6 @@ import com.google.common.eventbus.Subscribe; import lombok.Setter; -import org.apache.shardingsphere.infra.util.eventbus.EventBusContext; import org.apache.shardingsphere.metadata.persist.node.QualifiedDataSourceNode; import org.apache.shardingsphere.mode.event.deliver.DeliverEventSubscriber; import org.apache.shardingsphere.mode.event.deliver.QualifiedDataSourceDeletedEvent; @@ -42,8 +41,4 @@ public final class ReadwriteSplittingQualifiedDataSourceDeletedSubscriber implem public void delete(final QualifiedDataSourceDeletedEvent event) { repository.delete(QualifiedDataSourceNode.getQualifiedDataSourceNodePath(event.getQualifiedDataSource())); } - - @Override - public void setEventBusContext(final EventBusContext eventBusContext) { - } } diff --git a/mode/api/src/main/java/org/apache/shardingsphere/mode/event/deliver/DeliverEventSubscriber.java b/mode/api/src/main/java/org/apache/shardingsphere/mode/event/deliver/DeliverEventSubscriber.java index 479f027f4d999..bd0672e2433d0 100644 --- a/mode/api/src/main/java/org/apache/shardingsphere/mode/event/deliver/DeliverEventSubscriber.java +++ b/mode/api/src/main/java/org/apache/shardingsphere/mode/event/deliver/DeliverEventSubscriber.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.mode.event.deliver; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; -import org.apache.shardingsphere.infra.util.eventbus.EventBusContext; import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber; import org.apache.shardingsphere.mode.spi.PersistRepository; @@ -34,11 +33,4 @@ public interface DeliverEventSubscriber extends EventSubscriber { * @param repository persist repository */ void setRepository(PersistRepository repository); - - /** - * Set event bus context. - * - * @param eventBusContext event bus context - */ - void setEventBusContext(EventBusContext eventBusContext); } diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java index a325999b198c2..647a069209343 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java @@ -81,7 +81,7 @@ private void registerOnline(final ComputeNodeInstanceContext computeNodeInstance contextManager.getComputeNodeInstanceContext().getAllClusterInstances().addAll(contextManager.getPersistServiceFacade().getComputeNodePersistService().loadAllComputeNodeInstances()); new DataChangedEventListenerRegistry(contextManager, getDatabaseNames(param, contextManager.getPersistServiceFacade().getMetaDataPersistService())).register(); ClusterEventSubscriberRegistry eventSubscriberRegistry = new ClusterEventSubscriberRegistry(contextManager.getComputeNodeInstanceContext().getEventBusContext()); - eventSubscriberRegistry.register(createDeliverEventSubscribers(contextManager, repository)); + eventSubscriberRegistry.register(createDeliverEventSubscribers(repository)); eventSubscriberRegistry.register(new ClusterDispatchEventSubscriberRegistry(contextManager).getSubscribers()); } @@ -91,11 +91,10 @@ private Collection getDatabaseNames(final ContextManagerBuilderParameter : metaDataPersistService.getDatabaseMetaDataFacade().getDatabase().loadAllDatabaseNames(); } - private Collection createDeliverEventSubscribers(final ContextManager contextManager, final ClusterPersistRepository repository) { + private Collection createDeliverEventSubscribers(final ClusterPersistRepository repository) { Collection result = new LinkedList<>(); for (DeliverEventSubscriber each : ShardingSphereServiceLoader.getServiceInstances(DeliverEventSubscriber.class)) { each.setRepository(repository); - each.setEventBusContext(contextManager.getComputeNodeInstanceContext().getEventBusContext()); result.add(each); } return result;