Skip to content

Commit

Permalink
Remove CacheEvictedSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Jan 2, 2025
1 parent 4d9ce96 commit 70e48e5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.exception.core.external.sql.type.wrapper.SQLWrapperException;
import org.apache.shardingsphere.infra.spi.type.ordered.cache.OrderedServicesCache;
import org.apache.shardingsphere.metadata.persist.node.DatabaseMetaDataNode;
import org.apache.shardingsphere.mode.event.DataChangedEvent;
import org.apache.shardingsphere.mode.manager.ContextManager;
Expand All @@ -43,6 +44,7 @@ public void onChange(final DataChangedEvent event) {
if (!databaseName.isPresent()) {
return;
}
OrderedServicesCache.clearCache();
if (new MetaDataChangedHandler(contextManager).handle(databaseName.get(), event)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type;

import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.spi.type.ordered.cache.OrderedServicesCache;
import org.apache.shardingsphere.mode.event.DataChangedEvent;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.handler.DataChangedEventHandler;
Expand All @@ -36,6 +37,7 @@ public final class GlobalMetaDataChangedHandler implements DataChangedEventListe
@Override
public void onChange(final DataChangedEvent event) {
if (handler.getSubscribedTypes().contains(event.getType())) {
OrderedServicesCache.clearCache();
handler.handle(contextManager, event);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import lombok.Getter;
import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.CacheEvictedSubscriber;

import java.util.Collection;
import java.util.Collections;
Expand All @@ -33,6 +32,6 @@ public final class ClusterDispatchEventSubscriberRegistry {
private final Collection<EventSubscriber> subscribers;

public ClusterDispatchEventSubscriberRegistry() {
subscribers = Collections.singleton(new CacheEvictedSubscriber());
subscribers = Collections.emptyList();
}
}

This file was deleted.

This file was deleted.

0 comments on commit 70e48e5

Please sign in to comment.