Examples of extractShardId()


Examples of org.makersoft.shards.id.IdGenerator.extractShardId()

      return shard.getShardIds().iterator().next();
    } else {
      //TODO(fengkuok) 似乎从来不会走到这个逻辑
      IdGenerator idGenerator = shardedSqlSessionFactory.getIdGenerator();
      if (idGenerator != null) {
        return idGenerator.extractShardId(this.extractId(parameter));
      } else {
        // TODO(tomislav): also use shard resolution strategy if it returns only 1 shard;
        // throw this error in config instead of here
        throw new RuntimeException(
            "Can not use virtual sharding with non-shard resolving id gen");
View Full Code Here

Examples of org.makersoft.shards.id.IdGenerator.extractShardId()

  List<ShardId> selectShardIdsFromShardResolutionStrategyData(ShardResolutionStrategyData srsd) {
    IdGenerator idGenerator = shardedSqlSessionFactory.getIdGenerator();
    if ((idGenerator != null) && (srsd.getId() != null)) {
      //
      return Collections.singletonList(idGenerator.extractShardId(srsd.getId()));
    }
    return shardStrategy.getShardResolutionStrategy()
        .selectShardIdsFromShardResolutionStrategyData(srsd);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.