diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2021-10-15 16:59:45 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2021-10-15 16:59:45 +0200 |
commit | 4c1ca8d9b431c59895666256ad6e47193789b2b4 (patch) | |
tree | 4d4ae9ab2f2e1ccda7911e4cef2da3272a235989 /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java | |
parent | 5f13963aed2a5fe94d2d384954adf5c59e5231af (diff) |
Improve logging of FleetController and DatabaseHandler
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java')
-rw-r--r-- | clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java index 2a0ab389865..e7aae087626 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java @@ -16,12 +16,6 @@ import com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter; import org.junit.Before; import org.junit.Test; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; @@ -29,6 +23,12 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + public class StateChangeTest extends FleetControllerTest { public static Logger log = Logger.getLogger(StateChangeTest.class.getName()); @@ -49,16 +49,17 @@ public class StateChangeTest extends FleetControllerTest { nodes.add(new Node(NodeType.DISTRIBUTOR, i)); } + var context = new TestContext(options); communicator = new DummyCommunicator(nodes, timer); - MetricUpdater metricUpdater = new MetricUpdater(new NoMetricReporter(), options.fleetControllerIndex, options.clusterName); + var metricUpdater = new MetricUpdater(new NoMetricReporter(), options.fleetControllerIndex, options.clusterName); eventLog = new EventLog(timer, metricUpdater); - ContentCluster cluster = new ContentCluster(options.clusterName, options.nodes, options.storageDistribution); - NodeStateGatherer stateGatherer = new NodeStateGatherer(timer, timer, eventLog); - DatabaseHandler database = new DatabaseHandler(new ZooKeeperDatabaseFactory(), timer, options.zooKeeperServerAddress, options.fleetControllerIndex, timer); - StateChangeHandler stateGenerator = new StateChangeHandler(timer, eventLog); - SystemStateBroadcaster stateBroadcaster = new SystemStateBroadcaster(timer, timer); - MasterElectionHandler masterElectionHandler = new MasterElectionHandler(options.fleetControllerIndex, options.fleetControllerCount, timer, timer); - ctrl = new FleetController(timer, eventLog, cluster, stateGatherer, communicator, null, null, communicator, database, stateGenerator, stateBroadcaster, masterElectionHandler, metricUpdater, options); + var cluster = new ContentCluster(options.clusterName, options.nodes, options.storageDistribution); + var stateGatherer = new NodeStateGatherer(timer, timer, eventLog); + var database = new DatabaseHandler(context, new ZooKeeperDatabaseFactory(), timer, options.zooKeeperServerAddress, timer); + var stateGenerator = new StateChangeHandler(timer, eventLog); + var stateBroadcaster = new SystemStateBroadcaster(timer, timer); + var masterElectionHandler = new MasterElectionHandler(context, options.fleetControllerIndex, options.fleetControllerCount, timer, timer); + ctrl = new FleetController(context, timer, eventLog, cluster, stateGatherer, communicator, null, null, communicator, database, stateGenerator, stateBroadcaster, masterElectionHandler, metricUpdater, options); ctrl.tick(); if (options.fleetControllerCount == 1) { |