Skip to content

Commit

Permalink
Move ReadwriteSplittingQualifiedDataSourceDeletedSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Dec 13, 2024
1 parent 93965c6 commit a44edbd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.readwritesplitting.subscriber;
package org.apache.shardingsphere.readwritesplitting.cluster;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.readwritesplitting.subscriber;
package org.apache.shardingsphere.readwritesplitting.cluster;

import com.google.common.eventbus.Subscribe;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.readwritesplitting.subscriber;
package org.apache.shardingsphere.readwritesplitting.cluster;

import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDataSource;
import org.apache.shardingsphere.infra.rule.attribute.datasource.StaticDataSourceRuleAttribute;
import org.apache.shardingsphere.infra.state.datasource.DataSourceState;
import org.apache.shardingsphere.readwritesplitting.subscriber.ReadwriteSplittingQualifiedDataSourceDeletedEvent;
import org.apache.shardingsphere.readwritesplitting.cluster.ReadwriteSplittingQualifiedDataSourceDeletedEvent;
import org.apache.shardingsphere.readwritesplitting.exception.logic.ReadwriteSplittingDataSourceRuleNotFoundException;
import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceGroupRule;

Expand Down Expand Up @@ -68,8 +68,7 @@ public void cleanStorageNodeDataSources() {
}

private void deleteStorageNodeDataSources(final ReadwriteSplittingDataSourceGroupRule rule) {
rule.getReadwriteSplittingGroup().getReadDataSources()
.forEach(each -> computeNodeInstanceContext.getEventBusContext()
.post(new ReadwriteSplittingQualifiedDataSourceDeletedEvent(new QualifiedDataSource(databaseName, rule.getName(), each))));
rule.getReadwriteSplittingGroup().getReadDataSources().forEach(each -> computeNodeInstanceContext.getEventBusContext()
.post(new ReadwriteSplittingQualifiedDataSourceDeletedEvent(new QualifiedDataSource(databaseName, rule.getName(), each))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

org.apache.shardingsphere.readwritesplitting.subscriber.ReadwriteSplittingQualifiedDataSourceDeletedSubscriberFactory
org.apache.shardingsphere.readwritesplitting.cluster.ReadwriteSplittingQualifiedDataSourceDeletedSubscriberFactory
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.readwritesplitting.subscriber;
package org.apache.shardingsphere.readwritesplitting.cluster;

import org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDataSource;
import org.apache.shardingsphere.mode.spi.PersistRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext;
import org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDataSource;
import org.apache.shardingsphere.infra.state.datasource.DataSourceState;
import org.apache.shardingsphere.readwritesplitting.subscriber.ReadwriteSplittingQualifiedDataSourceDeletedEvent;
import org.apache.shardingsphere.readwritesplitting.cluster.ReadwriteSplittingQualifiedDataSourceDeletedEvent;
import org.apache.shardingsphere.readwritesplitting.exception.logic.ReadwriteSplittingDataSourceRuleNotFoundException;
import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceGroupRule;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit a44edbd

Please sign in to comment.