Skip to content

Commit

Permalink
Remove useless DispatchEvent (apache#34220)
Browse files Browse the repository at this point in the history
* Remove useless DispatchEvent

* Remove useless DispatchEvent

* Remove useless DispatchEvent
  • Loading branch information
terrymanu authored Jan 1, 2025
1 parent 736ca92 commit 1138cde
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 307 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void handleCreatedOrAltered(final String databaseName, final String schem
}

/**
* Handle table altered.
* Handle table dropped.
*
* @param databaseName database name
* @param schemaName schema name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void handleCreatedOrAltered(final String databaseName, final String schem
"Invalid active version: %s of key: %s", event.getValue(), event.getKey());
ShardingSphereView view = contextManager.getPersistServiceFacade().getMetaDataPersistService().getDatabaseMetaDataFacade().getView().load(databaseName, schemaName, viewName);
contextManager.getMetaDataContextManager().getSchemaMetaDataManager().alterSchema(databaseName, schemaName, null, view);
new ShardingSphereStatisticsRefreshEngine(contextManager).asyncRefresh();
statisticsRefreshEngine.asyncRefresh();
}

/**
Expand All @@ -65,6 +65,6 @@ public void handleCreatedOrAltered(final String databaseName, final String schem
public void handleDropped(final String databaseName, final String schemaName, final DataChangedEvent event) {
String viewName = ViewMetaDataNode.getViewName(event.getKey()).orElseThrow(() -> new IllegalStateException("View name not found."));
contextManager.getMetaDataContextManager().getSchemaMetaDataManager().alterSchema(databaseName, schemaName, null, viewName);
new ShardingSphereStatisticsRefreshEngine(contextManager).asyncRefresh();
statisticsRefreshEngine.asyncRefresh();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener;

import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
import org.apache.shardingsphere.metadata.persist.node.DatabaseMetaDataNode;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.handler.DataChangedEventHandler;
Expand All @@ -37,14 +36,11 @@ public final class DataChangedEventListenerRegistry {

private final ClusterPersistRepository repository;

private final EventBusContext eventBusContext;

private final Collection<String> databaseNames;

public DataChangedEventListenerRegistry(final ContextManager contextManager, final Collection<String> databaseNames) {
this.contextManager = contextManager;
repository = (ClusterPersistRepository) contextManager.getPersistServiceFacade().getRepository();
eventBusContext = contextManager.getComputeNodeInstanceContext().getEventBusContext();
this.databaseNames = databaseNames;
}

Expand Down

This file was deleted.

0 comments on commit 1138cde

Please sign in to comment.