You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/04/07 05:49:21 UTC

[shardingsphere] branch master updated: Removed useless worker-id props for sharding key generator (#16409)

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

jianglongtao 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 518e5fef653 Removed useless worker-id props for sharding key generator (#16409)
518e5fef653 is described below

commit 518e5fef653f71c98a9059bcc2e9419ece11b8ce
Author: Abhijeet Jejurkar <69...@users.noreply.github.com>
AuthorDate: Thu Apr 7 11:19:12 2022 +0530

    Removed useless worker-id props for sharding key generator (#16409)
    
    * Removed useless worker-id props for sharding key generator
    Fixes: #16302
    
    Signed-off-by: Abhijeet Jejurkar <ab...@gmail.com>
    
    * Removed work-id=123 on line 51
    Fixes: #16302
    
    Signed-off-by: Abhijeet Jejurkar <ab...@gmail.com>
---
 .../distsql/query/ShardingKeyGeneratorsQueryResultSetTest.java      | 6 ++----
 .../ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java      | 4 +---
 .../query/UnusedShardingKeyGeneratorsQueryResultSetTest.java        | 4 +---
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingKeyGeneratorsQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingKeyGeneratorsQueryResultSetTest.java
index e62249836d9..464a33d74f7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingKeyGeneratorsQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingKeyGeneratorsQueryResultSetTest.java
@@ -48,14 +48,12 @@ public final class ShardingKeyGeneratorsQueryResultSetTest {
         assertThat(actual.size(), is(3));
         assertThat(actual.get(0), is("snowflake"));
         assertThat(actual.get(1), is("SNOWFLAKE"));
-        assertThat(actual.get(2).toString(), is("{work-id=123}"));
+        assertThat(actual.get(2).toString(), is("{}"));
     }
     
     private Collection<ShardingRuleConfiguration> createRuleConfigurations() {
         ShardingRuleConfiguration result = new ShardingRuleConfiguration();
-        Properties props = new Properties();
-        props.put("work-id", 123);
-        result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", props));
+        result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", new Properties()));
         return Collections.singleton(result);
     }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
index dd15da7ec5a..281613698aa 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
@@ -108,8 +108,6 @@ public final class ShowShardingTableRulesUsedAlgorithmQueryResultSetTest {
     }
 
     private ShardingSphereAlgorithmConfiguration createKeyGeneratorConfiguration() {
-        Properties props = new Properties();
-        props.put("worker-id", "123");
-        return new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", props);
+        return new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", new Properties());
     }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingKeyGeneratorsQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingKeyGeneratorsQueryResultSetTest.java
index e106a906549..bca88a8fb70 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingKeyGeneratorsQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingKeyGeneratorsQueryResultSetTest.java
@@ -62,9 +62,7 @@ public final class UnusedShardingKeyGeneratorsQueryResultSetTest {
     }
     
     private ShardingSphereAlgorithmConfiguration createSnowflakeKeyGeneratorConfiguration() {
-        Properties props = new Properties();
-        props.put("work-id", 123);
-        return new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", props);
+        return new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", new Properties());
     }
     
     private ShardingAutoTableRuleConfiguration createShardingAutoTableRuleConfiguration() {