twillouer opened a new issue #9479:
URL: https://github.com/apache/shardingsphere/issues/9479


   ## Feature Request
   
   Less "toString" in some part of job to permit more performance
   
   ### Is your feature request related to a problem?
   
   in code, we can see something like this :
   
   ```java
       @Override
       public Collection<String> doSharding(final Collection<String> 
availableTargetNames, final Collection<RouteValue> shardingValues, final 
ConfigurationProperties properties) {
           RouteValue shardingValue = shardingValues.iterator().next();
           if 
(properties.<Boolean>getValue(ConfigurationPropertyKey.ALLOW_RANGE_QUERY_WITH_INLINE_SHARDING)
 && shardingValue instanceof RangeRouteValue) {
               return availableTargetNames;
           }
           Preconditions.checkState(shardingValue instanceof ListRouteValue, 
"Inline strategy cannot support this type sharding:" + 
shardingValue.toString());
           Collection<String> shardingResult = doSharding((ListRouteValue) 
shardingValue);
           Collection<String> result = new 
TreeSet<>(String.CASE_INSENSITIVE_ORDER);
           for (String each : shardingResult) {
               if (availableTargetNames.contains(each)) {
                   result.add(each);
               }
           }
           return result;
       }
   ```
   
   ### Describe the feature you would like.
   
   Precondictions.checkState(..., +toString()) will generate the string each 
time the call is done.
   Something like a lambda or avoid this precondition here can be mode effective
   
![image](https://user-images.githubusercontent.com/2970220/108922632-b2348f80-7637-11eb-8bba-48c12af7992d.png)
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to