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 2022/04/01 06:59:55 UTC

[GitHub] [shardingsphere] VeejaLiu commented on issue #16540: About developer friendliness?

VeejaLiu commented on issue #16540:
URL: https://github.com/apache/shardingsphere/issues/16540#issuecomment-1085504538


   And my sharding strategy:
   ```java
   /**
    * @author liuweijia
    * @email: weijialiu@hiretual.com
    */
   public class TestSharding implements PreciseShardingAlgorithm<String> {
   
       private static final String PREFIX = "database_";
   
       @Override
       public String doSharding(Collection<String> availableTargetNames, PreciseShardingValue<String> preciseShardingValue) {
           System.out.println("========single sharding========");
           if (preciseShardingValue != null) {
               String value = preciseShardingValue.getValue();
               return PREFIX + "team_" + value;
           }
           return PREFIX + "team_default";
       }
   }
   ```


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org