You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/09/12 05:57:42 UTC

[GitHub] [incubator-shardingsphere] KomachiSion commented on a change in pull request #3023: fix bug 2193

KomachiSion commented on a change in pull request #3023: fix bug 2193
URL: https://github.com/apache/incubator-shardingsphere/pull/3023#discussion_r323566234
 
 

 ##########
 File path: sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/strategy/route/inline/InlineShardingStrategy.java
 ##########
 @@ -58,7 +61,17 @@ public InlineShardingStrategy(final InlineShardingStrategyConfiguration inlineSh
         Preconditions.checkState(shardingValue instanceof ListRouteValue, "Inline strategy cannot support range sharding.");
         Collection<String> shardingResult = doSharding((ListRouteValue) shardingValue);
         Collection<String> result = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
-        result.addAll(shardingResult);
+        Map<String, String> availableTargetNamesMap = Maps.uniqueIndex(availableTargetNames, new Function<String, String>() {
+            @Override
+            public String apply(String input) {
+                return input;
+            }
+        });
 
 Review comment:
   This part may be unnecessary, because availableTargetNames must come from `TableRule`, and `TableRule` must return `LinkedHashSet`.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services