Package com.linkedin.d2.balancer.clients

Examples of com.linkedin.d2.balancer.clients.DynamicClient


                                                            schemes,
                                                            null));

    _clusterRegistry.put("cluster-1", new ClusterProperties("cluster-1"));

    LoadBalancerStrategy strategy = _state.getStrategy("service-1", "http");

    assertNotNull(strategy);
    assertTrue(strategy instanceof RandomLoadBalancerStrategy);

    // now add the degraderV3 strategy into the Strategy list
View Full Code Here


                                                              Collections.<String, Object>emptyMap(),
                                                              Collections.<String, String>emptyMap(),
                                                              schemes,
                                                              Collections.<URI>emptySet()));

    LoadBalancerStrategy strategy = _state.getStrategy("service-1", "http");
    assertNotNull(strategy, "got null strategy in setup");

    // test serial to make sure things are working before concurrent test
    TransportClient resultTC = _state.getClient("service-1", "http");
    assertNotNull(resultTC, "got null tracker client in non-concurrent env");
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

  {
    // define the load balancing strategies that we support (round robin, etc)
    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 =
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.clients.DynamicClient

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.