Package org.makersoft.shards.strategy.selection

Examples of org.makersoft.shards.strategy.selection.ShardSelectionStrategy


*/
public class UserShardStrategyFactory implements ShardStrategyFactory {
 
  @Override
  public ShardStrategy newShardStrategy(List<ShardId> shardIds) {
    ShardSelectionStrategy pss = this.getShardSelectionStrategy(shardIds);
    ShardResolutionStrategy prs = this.getShardResolutionStrategy(shardIds);
    ShardAccessStrategy pas = this.getShardAccessStrategy();
    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
View Full Code Here


    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
 
  private ShardSelectionStrategy getShardSelectionStrategy(final List<ShardId> shardIds){
    return new ShardSelectionStrategy(){

      @Override
      public ShardId selectShardIdForNewObject(String statement, Object obj) {
        if(obj instanceof User){
          User user = (User)obj;
View Full Code Here

    factory = new ShardedSqlSessionFactoryBuilder().build(shardConfigs,
        new ShardStrategyFactory() {

          @Override
          public ShardStrategy newShardStrategy(List<ShardId> shardIds) {
            ShardSelectionStrategy pss = new ShardSelectionStrategy() {

              @Override
              public ShardId selectShardIdForNewObject(String statement, Object obj) {
                return null;
              }
View Full Code Here

*/
public class HorizontalShardStrategyFactory implements ShardStrategyFactory {

  @Override
  public ShardStrategy newShardStrategy(List<ShardId> shardIds) {
    ShardSelectionStrategy pss = this.getShardSelectionStrategy(shardIds);
    ShardResolutionStrategy prs = this.getShardResolutionStrategy(shardIds);
    ShardAccessStrategy pas = this.getShardAccessStrategy();
    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
View Full Code Here

    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
 
  private ShardSelectionStrategy getShardSelectionStrategy(final List<ShardId> shardIds){
    return new ShardSelectionStrategy(){

      @Override
      public ShardId selectShardIdForNewObject(String statement, Object obj) {
        if(obj instanceof User){
          User user = (User)obj;
View Full Code Here

*/
public class VerticalShardStrategyFactory implements ShardStrategyFactory {
 
  @Override
  public ShardStrategy newShardStrategy(List<ShardId> shardIds) {
    ShardSelectionStrategy pss = this.getShardSelectionStrategy(shardIds);
    ShardResolutionStrategy prs = this.getShardResolutionStrategy(shardIds);
    ShardAccessStrategy pas = this.getShardAccessStrategy();
    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
View Full Code Here

    ShardReduceStrategy srs = this.getShardReduceStrategy();
    return new ShardStrategyImpl(pss, prs, pas, srs);
  }
 
  private ShardSelectionStrategy getShardSelectionStrategy(final List<ShardId> shardIds){
    return new ShardSelectionStrategy(){

      @Override
      public ShardId selectShardIdForNewObject(String statement, Object obj) {
        return null;
      }
View Full Code Here

TOP

Related Classes of org.makersoft.shards.strategy.selection.ShardSelectionStrategy

Copyright © 2018 www.massapicom. 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.