Examples of SettableClock


Examples of com.linkedin.util.clock.SettableClock

  public TrackerClient getClient(String serviceName, URI uri)
  {
    if (_partitionDescriptions.get(uri) != null)
    {
      // shorten the update interval to 20ms in order to increase the possibility of deadlock
      _trackerClients.putIfAbsent(uri, new TrackerClient(uri, _partitionDescriptions.get(uri), null, new SettableClock(), null, 20));

      return _trackerClients.get(uri);
    }
    return null;
  }
View Full Code Here

Examples of com.linkedin.util.clock.SettableClock

  public void testClient() throws URISyntaxException
  {
    URI uri = URI.create("http://test.qa.com:1234/foo");
    double weight = 3d;
    TestClient wrappedClient = new TestClient();
    Clock clock = new SettableClock();
    Map<Integer, PartitionData> partitionDataMap = new HashMap<Integer, PartitionData>(2);
    partitionDataMap.put(DefaultPartitionAccessor.DEFAULT_PARTITION_ID, new PartitionData(3d));
    TrackerClient client = new TrackerClient(uri, partitionDataMap, wrappedClient, clock, null);

    assertEquals(client.getUri(), uri);
View Full Code Here

Examples of com.linkedin.util.clock.SettableClock

  private long _lastSetClockToNextInterval;

  @BeforeMethod
  public void setUp() throws Exception
  {
    _clock = new SettableClock();
    _callTracker = new CallTrackerImpl(_defaultInterval, _clock);

    _config = new DegraderImpl.Config();

    _config.setName(_defaultName);
View Full Code Here

Examples of com.linkedin.util.clock.SettableClock

  private SettableClock _clock;

  @BeforeMethod
  protected void setUp() throws Exception
  {
    _clock = new SettableClock();
    _callTracker = new CallTrackerImpl(_interval, _clock);
  }
View Full Code Here

Examples of com.linkedin.util.clock.SettableClock

    }

    // test same cluster generation id but different client lists
    strategy = getStrategy();
    List<TrackerClient> clients1 = new ArrayList<TrackerClient>();
    SettableClock clock1 = new SettableClock();
    SettableClock clock2 = new SettableClock();
    List<TrackerClient> clients2 = new ArrayList<TrackerClient>();
    SettableClock clock3 = new SettableClock();
    SettableClock clock4 = new SettableClock();

    clients1.add(getClient(URI.create("http://test.linkedin.com:3242/fdsaf"), clock1));
    clients1.add(getClient(URI.create("http://test.linkedin.com:3243/fdsaf"), clock2));

    clients2.add(getClient(URI.create("http://asdbasdf.com:3242/fdsaf"), clock3));
View Full Code Here

Examples of com.linkedin.util.clock.SettableClock

  {
    DegraderLoadBalancerStrategyV3 strategy =
        new DegraderLoadBalancerStrategyV3(new DegraderLoadBalancerStrategyConfig(5000),
                                           "DegraderLoadBalancerTest", null);
    List<TrackerClient> clients = new ArrayList<TrackerClient>();
    SettableClock clock1 = new SettableClock();
    SettableClock clock2 = new SettableClock();

    clients.add(getClient(URI.create("http://test.linkedin.com:3242/fdsaf"), clock1));
    clients.add(getClient(URI.create("http://test.linkedin.com:3243/fdsaf"), clock2));

    clock1.addDuration(5000);
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.