diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/listener/type/DatabaseMetaDataChangedListener.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/listener/type/DatabaseMetaDataChangedListener.java index e0d6c1553780b..8d8d0f46f47fb 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/listener/type/DatabaseMetaDataChangedListener.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/event/dispatch/listener/type/DatabaseMetaDataChangedListener.java @@ -34,10 +34,6 @@ @RequiredArgsConstructor public final class DatabaseMetaDataChangedListener implements DataChangedEventListener { - private final MetaDataChangedEventBuilder metaDataChangedEventBuilder = new MetaDataChangedEventBuilder(); - - private final RuleConfigurationChangedEventBuilder ruleConfigChangedEventBuilder = new RuleConfigurationChangedEventBuilder(); - private final EventBusContext eventBusContext; @Override @@ -51,7 +47,7 @@ private Optional createDispatchEvent(final DataChangedEvent event if (!databaseName.isPresent()) { return Optional.empty(); } - Optional metaDataChangedEvent = metaDataChangedEventBuilder.build(databaseName.get(), event); - return metaDataChangedEvent.isPresent() ? metaDataChangedEvent : ruleConfigChangedEventBuilder.build(databaseName.get(), event); + Optional metaDataChangedEvent = new MetaDataChangedEventBuilder().build(databaseName.get(), event); + return metaDataChangedEvent.isPresent() ? metaDataChangedEvent : new RuleConfigurationChangedEventBuilder().build(databaseName.get(), event); } }