Package io.druid.server.coordinator

Examples of io.druid.server.coordinator.CostBalancerStrategy


  {
    setupDummyCluster(10, 20);
    DataSegment segment = getSegment(1000);

    final DateTime referenceTimestamp = new DateTime("2014-01-01");
    BalancerStrategy strategy = new CostBalancerStrategy(referenceTimestamp, 4);
    ServerHolder holder = strategy.findNewSegmentHomeReplicator(segment, serverHolderList);
    Assert.assertNotNull("Should be able to find a place for new segment!!", holder);
    Assert.assertEquals("Best Server should be BEST_SERVER", "BEST_SERVER", holder.getServer().getName());
  }
View Full Code Here


  {
    setupDummyCluster(10, 20);
    DataSegment segment = getSegment(1000);

    final DateTime referenceTimestamp = new DateTime("2014-01-01");
    BalancerStrategy strategy = new CostBalancerStrategy(referenceTimestamp, 1);
    ServerHolder holder = strategy.findNewSegmentHomeReplicator(segment, serverHolderList);
    Assert.assertNotNull("Should be able to find a place for new segment!!", holder);
    Assert.assertEquals("Best Server should be BEST_SERVER", "BEST_SERVER", holder.getServer().getName());
  }
View Full Code Here

  public void testBenchmark() throws InterruptedException
  {
    setupDummyCluster(100, 500);
    DataSegment segment = getSegment(1000);

    BalancerStrategy singleThreadStrategy = new CostBalancerStrategy(DateTime.now(DateTimeZone.UTC), 1);
    long start = System.currentTimeMillis();
    singleThreadStrategy.findNewSegmentHomeReplicator(segment, serverHolderList);
    long end = System.currentTimeMillis();
    long latencySingleThread = end - start;

    BalancerStrategy strategy = new CostBalancerStrategy(DateTime.now(DateTimeZone.UTC), 4);
    start = System.currentTimeMillis();
    strategy.findNewSegmentHomeReplicator(segment, serverHolderList);
    end = System.currentTimeMillis();
    long latencyMultiThread = end - start;

    System.err.println("Latency - Single Threaded (ms): " + latencySingleThread);
    System.err.println("Latency - Multi Threaded (ms): " + latencyMultiThread);
View Full Code Here

TOP

Related Classes of io.druid.server.coordinator.CostBalancerStrategy

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.