diff --git a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java index 8989d8797d2..47f7fb19436 100644 --- a/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java +++ b/server/src/main/java/com/metamx/druid/master/CostBalancerStrategy.java @@ -32,10 +32,10 @@ import java.util.List; public class CostBalancerStrategy implements BalancerStrategy { private static final EmittingLogger log = new EmittingLogger(CostBalancerStrategy.class); - private final DateTime referenceTimestamp; private static final int DAY_IN_MILLIS = 1000 * 60 * 60 * 24; private static final int SEVEN_DAYS_IN_MILLIS = 7 * DAY_IN_MILLIS; private static final int THIRTY_DAYS_IN_MILLIS = 30 * DAY_IN_MILLIS; + private final DateTime referenceTimestamp; public CostBalancerStrategy(DateTime referenceTimestamp) { diff --git a/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java b/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java index 4364f02073c..35f3661bb4c 100644 --- a/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java +++ b/server/src/test/java/com/metamx/druid/utils/DruidMasterBalancerProfiler.java @@ -1,3 +1,22 @@ +/* +* Druid - a distributed column store. +* Copyright (C) 2012 Metamarkets Group Inc. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + package com.metamx.druid.utils; import com.google.common.base.Stopwatch; @@ -44,8 +63,6 @@ public class DruidMasterBalancerProfiler private DruidServer druidServer1; private DruidServer druidServer2; Map segments = Maps.newHashMap(); - DateTime start1 = new DateTime("2012-01-01"); - DateTime version = new DateTime("2012-03-01"); ServiceEmitter emitter; DatabaseRuleManager manager; PeriodLoadRule loadRule = new PeriodLoadRule(new Period("P5000Y"),3,"normal"); @@ -65,8 +82,8 @@ public class DruidMasterBalancerProfiler public void bigProfiler() { Stopwatch watch = new Stopwatch(); - int numServers = 55000; - + int numSegments = 55000; + int numServers=50; EasyMock.expect(manager.getAllRules()).andReturn(ImmutableMap.>of("test", rules)).anyTimes(); EasyMock.expect(manager.getRules(EasyMock.anyObject())).andReturn(rules).anyTimes(); EasyMock.expect(manager.getRulesWithDefault(EasyMock.anyObject())).andReturn(rules).anyTimes(); @@ -85,7 +102,7 @@ public class DruidMasterBalancerProfiler Map peonMap = Maps.newHashMap(); List serverHolderList = Lists.newArrayList(); Map segmentMap = Maps.newHashMap(); - for (int i=0;i