Skip to content

Commit

Permalink
Remove useless StaticDataSourceRuleAttribute.getDataSourceMapper() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Nov 7, 2024
1 parent e0a691f commit b5bf2af
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
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

0 comments on commit b5bf2af

Please sign in to comment.