Package com.linkedin.d2.balancer.strategies

Examples of com.linkedin.d2.balancer.strategies.LoadBalancerStrategy


  @Override
  public LoadBalancerStrategy getStrategy(String serviceName, String scheme)
  {
    Map<String, LoadBalancerStrategy> strategies = _serviceStrategies.get(serviceName);
    LoadBalancerStrategy strategy = null;

    if (strategies != null)
    {
      strategy = strategies.get(scheme);
    }
View Full Code Here


      List<SchemeStrategyPair> orderedStrategies = new ArrayList<SchemeStrategyPair>(prioritizedSchemes.size());
      for (String scheme : prioritizedSchemes)
      {
        // get the strategy for this service and scheme
        LoadBalancerStrategy strategy = getStrategy(serviceName, scheme);

        if (strategy != null)
        {
          orderedStrategies.add(new SchemeStrategyPair(scheme, strategy));
        }
View Full Code Here

      for (String scheme : schemes)
      {
        Map<String, Object> loadBalancerStrategyProperties =
            new HashMap<String, Object>(serviceProperties.getLoadBalancerStrategyProperties());

        LoadBalancerStrategy strategy = factory.newLoadBalancer(
            serviceProperties.getServiceName(),
            loadBalancerStrategyProperties,
            serviceProperties.getDegraderProperties());

        strategyMap.put(scheme, strategy);
View Full Code Here

  {
    final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =
        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();

    final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory();
    final DegraderLoadBalancerStrategyFactoryV2 degraderStrategyFactoryV2 = new DegraderLoadBalancerStrategyFactoryV2();
    final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3();
    final DegraderLoadBalancerStrategyFactoryV2_1 degraderStrategyFactoryV2_1 = new DegraderLoadBalancerStrategyFactoryV2_1();

    loadBalancerStrategyFactories.put("random", randomStrategyFactory);
    loadBalancerStrategyFactories.put("degrader", degraderStrategyFactoryV2);
View Full Code Here

        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();

    final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory();
    final DegraderLoadBalancerStrategyFactoryV2 degraderStrategyFactoryV2 = new DegraderLoadBalancerStrategyFactoryV2();
    final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3();
    final DegraderLoadBalancerStrategyFactoryV2_1 degraderStrategyFactoryV2_1 = new DegraderLoadBalancerStrategyFactoryV2_1();

    loadBalancerStrategyFactories.put("random", randomStrategyFactory);
    loadBalancerStrategyFactories.put("degrader", degraderStrategyFactoryV2);
    loadBalancerStrategyFactories.put("degraderV2", degraderStrategyFactoryV2);
    loadBalancerStrategyFactories.put("degraderV3", degraderStrategyFactoryV3);
View Full Code Here

    final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =
        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();

    final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory();
    final DegraderLoadBalancerStrategyFactoryV2 degraderStrategyFactoryV2 = new DegraderLoadBalancerStrategyFactoryV2();
    final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3();
    final DegraderLoadBalancerStrategyFactoryV2_1 degraderStrategyFactoryV2_1 = new DegraderLoadBalancerStrategyFactoryV2_1();

    loadBalancerStrategyFactories.put("random", randomStrategyFactory);
    loadBalancerStrategyFactories.put("degrader", degraderStrategyFactoryV2);
    loadBalancerStrategyFactories.put("degraderV2", degraderStrategyFactoryV2);
View Full Code Here

    Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =
        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();

    loadBalancerStrategyFactories.put("rr", new RandomLoadBalancerStrategyFactory());
    loadBalancerStrategyFactories.put("degrader",
                                      new DegraderLoadBalancerStrategyFactoryV3());

    // define the clients that we support (http, etc)
    Map<String, TransportClientFactory> clientFactories =
        new HashMap<String, TransportClientFactory>();
View Full Code Here

    _serviceRegistry = new MockStore<ServiceProperties>();
    _clientFactories = new HashMap<String, TransportClientFactory>();
    _loadBalancerStrategyFactories =
        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();
    _loadBalancerStrategyFactories.put("random", new RandomLoadBalancerStrategyFactory());
    _loadBalancerStrategyFactories.put("degraderV3", new DegraderLoadBalancerStrategyFactoryV3());
    try {
      _sslContext = SSLContext.getDefault();
    }
    catch (NoSuchAlgorithmException e)
    {
View Full Code Here

  }

  @Override
  public LoadBalancerStrategy getStrategy(String serviceName, String scheme)
  {
    return (getStrategy) ? new RandomLoadBalancerStrategy() : null;
  }
View Full Code Here

  private Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> createDefaultLoadBalancerStrategyFactories()
  {
    final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =
        new HashMap<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>>();

    final RandomLoadBalancerStrategyFactory randomStrategyFactory = new RandomLoadBalancerStrategyFactory();
    final DegraderLoadBalancerStrategyFactoryV2 degraderStrategyFactoryV2 = new DegraderLoadBalancerStrategyFactoryV2();
    final DegraderLoadBalancerStrategyFactoryV3 degraderStrategyFactoryV3 = new DegraderLoadBalancerStrategyFactoryV3();
    final DegraderLoadBalancerStrategyFactoryV2_1 degraderStrategyFactoryV2_1 = new DegraderLoadBalancerStrategyFactoryV2_1();

    loadBalancerStrategyFactories.put("random", randomStrategyFactory);
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.strategies.LoadBalancerStrategy

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.