Package com.linkedin.d2.balancer.util

Examples of com.linkedin.d2.balancer.util.URIRequest


                                      List<TrackerClient> clients, TestClock clock, Long timeInterval)
  {
    //test clusterOverrideDropRate won't increase even though latency is 3000 ms because the traffic is low
    callClients(3000, 0.2, clients, clock, timeInterval, false, false);
    strategyAdapter.setStrategyToCallDrop();
    URIRequest request = new URIRequest(clients.get(0).getUri());
    getTrackerClient(strategyAdapter, request, new RequestContext(), 1, clients);
    assertTrue(isEqual(0.0d, strategyAdapter.getCurrentOverrideDropRate()));

    //if we increase the QPS from 0.2 to 25, then we'll start dropping calls
    callClients(3000, 25, clients, clock, timeInterval, false, false);
View Full Code Here


    final int NUM_CHECKS = 10;
    final Map<TrackerClient,Integer> serverCounts = new HashMap<TrackerClient, Integer>();

    for (int i = 0; i < NUM_URIS; i++)
    {
      URIRequest request = new URIRequest("d2://fooService/this/is/a/test/" + i);
      TrackerClient lastClient = null;
      for (int j = 0; j < NUM_CHECKS; j++)
      {
        TrackerClient client = getTrackerClient(strategy, request, new RequestContext(), 0, clients);
        assertNotNull(client);
View Full Code Here

      DegraderLoadBalancerStrategyConfig config = DegraderLoadBalancerStrategyConfig.createHttpConfigFromMap(myMap);

      List<TrackerClient> clients = new ArrayList<TrackerClient>();
      URI uri1 = URI.create("http://test.linkedin.com:3242/fdsaf");
      URIRequest request = new URIRequest(uri1);

      TrackerClient client1 =
              new TrackerClient(uri1, getDefaultPartitionData(1d), new TestLoadBalancerClient(uri1), clock, null);

      clients.add(client1);
View Full Code Here

    DegraderLoadBalancerStrategyConfig config = DegraderLoadBalancerStrategyConfig.createHttpConfigFromMap(myMap);

    List<TrackerClient> clients = new ArrayList<TrackerClient>();
    URI uri1 = URI.create("http://test.linkedin.com:3242/fdsaf");
    URIRequest request = new URIRequest(uri1);

    TrackerClient client1 =
            new TrackerClient(uri1, getDefaultPartitionData(1d), new TestLoadBalancerClient(uri1), clock, null);

    clients.add(client1);
View Full Code Here

  {
    callClients(latency, qps, clients, clock, timeInterval, isCalledWithError, isCalledWithErrorForLoadBalancing);
    //create any random URIRequest because we just need a URI to be hashed to get the point in hash ring anyway
    if (clients != null && !clients.isEmpty())
    {
      URIRequest request = new URIRequest(clients.get(0).getUri());
      TrackerClient client = getTrackerClient(adapter, request, new RequestContext(), clusterGenerationId, clients);
      Map<URI, Integer> pointsMap = adapter.getPointsMap();
      for (TrackerClient trackerClient : clients)
      {
        Integer pointsInTheRing = pointsMap.get(trackerClient.getUri());
View Full Code Here

    DegraderLoadBalancerStrategyV3 strategy = new DegraderLoadBalancerStrategyV3(config, "DegraderLoadBalancerTest",
                                                                                 null);

    List<TrackerClient> clients = new ArrayList<TrackerClient>();
    URI uri1 = URI.create("http://test.linkedin.com:3242/fdsaf");
    URIRequest request = new URIRequest(uri1);

    TrackerClient client1 =
            new TrackerClient(uri1, getDefaultPartitionData(1d), new TestLoadBalancerClient(uri1), clock, null);

    clients.add(client1);
View Full Code Here

                                                                                 null);

    List<TrackerClient> clients = new ArrayList<TrackerClient>();
    URI uri1 = URI.create("http://test.linkedin.com:3242/fdsaf");
    URI uri2 = URI.create("http://test.linkedin.com:3243/fdsaf");
    URIRequest request = new URIRequest(uri1);

    List<CallCompletion> ccList = new ArrayList<CallCompletion>();
    CallCompletion cc;

    TrackerClient client1 =
View Full Code Here

    DegraderLoadBalancerStrategyV3 strategy = new DegraderLoadBalancerStrategyV3(config, "DegraderLoadBalancerTest",
                                                                                 null);

    List<TrackerClient> clients = new ArrayList<TrackerClient>();
    URI uri1 = URI.create("http://test.linkedin.com:3242/fdsaf");
    URIRequest request = new URIRequest(uri1);

    List<CallCompletion> ccList = new ArrayList<CallCompletion>();
    CallCompletion cc;

    TrackerClient client1 =
View Full Code Here

  public static void testBuildAllPartitionsRequest(RestliRequestOptions options) throws ServiceUnavailableException, URISyntaxException, RestException
  {

    final int PARTITION_NUM = 10;

    ConsistentHashKeyMapper mapper = getKeyToHostMapper(PARTITION_NUM);

    AllPartitionsRequestBuilder<CollectionResponse<Greeting>> searchRB = new AllPartitionsRequestBuilder<CollectionResponse<Greeting>>(mapper);
    FindRequestBuilder<Long, Greeting> findRB = new FindRequestBuilder<Long, Greeting>(TEST_URI,
                                                                                       Greeting.class,
                                                                                       _COLL_SPEC,
View Full Code Here

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "restliRequestOptions")
  public static void testSendAllPartitionsRequests(RestliRequestOptions options) throws ServiceUnavailableException, URISyntaxException, RestException, InterruptedException
  {
    final int PARTITION_NUM = 10;
    ConsistentHashKeyMapper mapper = getKeyToHostMapper(PARTITION_NUM);
    AllPartitionsRequestBuilder<Greeting> searchRB = new AllPartitionsRequestBuilder<Greeting>(mapper);
    ActionRequestBuilder<Long, Greeting> builder = new ActionRequestBuilder<Long, Greeting>(TEST_URI,
                                                                                            Greeting.class,
                                                                                            _COLL_SPEC,
                                                                                            options);
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.util.URIRequest

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.