Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless StaticDataSourceRuleAttribute.getDataSourceMapper() #33587

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.apache.shardingsphere.readwritesplitting.exception.logic.ReadwriteSplittingDataSourceRuleNotFoundException;
import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceGroupRule;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

Expand All @@ -44,15 +42,6 @@ public final class ReadwriteSplittingStaticDataSourceRuleAttribute implements St

private final ComputeNodeInstanceContext computeNodeInstanceContext;

@Override
public Map<String, Collection<String>> getDataSourceMapper() {
Map<String, Collection<String>> result = new HashMap<>(dataSourceGroupRules.size(), 1F);
for (Entry<String, ReadwriteSplittingDataSourceGroupRule> entry : dataSourceGroupRules.entrySet()) {
result.put(entry.getValue().getName(), entry.getValue().getReadwriteSplittingGroup().getAllDataSources());
}
return result;
}

@Override
public void updateStatus(final QualifiedDataSource qualifiedDataSource, final DataSourceState status) {
ReadwriteSplittingDataSourceGroupRule dataSourceGroupRule = dataSourceGroupRules.get(qualifiedDataSource.getGroupName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,11 @@
import org.apache.shardingsphere.infra.rule.attribute.RuleAttribute;
import org.apache.shardingsphere.infra.state.datasource.DataSourceState;

import java.util.Collection;
import java.util.Map;

/**
* Static data source rule attribute.
*/
public interface StaticDataSourceRuleAttribute extends RuleAttribute {

/**
* Get data source mapper.
*
* @return data source mapper
*/
Map<String, Collection<String>> getDataSourceMapper();

/**
* Update data source status.
*
Expand Down