This is an automated email from the ASF dual-hosted git repository.

wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new c20eddf  Remove useless codes (#10756)
c20eddf is described below

commit c20eddf83c5e7f12d33e3277745375cc579d1330
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jun 10 23:24:13 2021 +0800

    Remove useless codes (#10756)
---
 .../apache/shardingsphere/sharding/rule/ShardingRule.java  | 14 --------------
 .../shardingsphere/sharding/rule/ShardingRuleTest.java     | 10 ----------
 2 files changed, 24 deletions(-)

diff --git 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
index e462de8..0c6facb 100644
--- 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
+++ 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
@@ -430,20 +430,6 @@ public final class ShardingRule implements FeatureRule, 
SchemaRule, DataNodeCont
     }
     
     /**
-     * Find data node by data source and logic table.
-     *
-     * @param dataSourceName data source name
-     * @param logicTableName logic table name
-     * @return data node
-     */
-    public DataNode getDataNode(final String dataSourceName, final String 
logicTableName) {
-        TableRule tableRule = getTableRule(logicTableName);
-        return tableRule.getActualDataNodes().stream().filter(each -> 
dataSourceNames.contains(each.getDataSourceName())
-                && each.getDataSourceName().equals(dataSourceName)).findFirst()
-                .orElseThrow(() -> new 
ShardingSphereConfigurationException("Cannot find actual data node for data 
source name: '%s' and logic table name: '%s'", dataSourceName, logicTableName));
-    }
-    
-    /**
      * Get sharding logic table names.
      *
      * @param logicTableNames logic table names
diff --git 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
index cf0473d..4a704c6 100644
--- 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
+++ 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
@@ -270,16 +270,6 @@ public final class ShardingRuleTest {
     }
     
     @Test
-    public void assertGetDataNodeByDataSourceAndLogicTable() {
-        assertThat(createMaximumShardingRule().getDataNode("ds_1", 
"logic_table"), is(new DataNode("ds_1.table_0")));
-    }
-    
-    @Test(expected = ShardingSphereConfigurationException.class)
-    public void assertGetDataNodeByLogicTableFailureWithDataSourceName() {
-        createMaximumShardingRule().getDataNode("ds_3", "logic_table");
-    }
-    
-    @Test
     public void assertGetShardingLogicTableNames() {
         ShardingRule actual = createMaximumShardingRule();
         
assertThat(actual.getShardingLogicTableNames(Arrays.asList("LOGIC_TABLE", 
"BROADCAST_TABLE")), is(Collections.singletonList("LOGIC_TABLE")));

Reply via email to