/** * run the setup phase and restore all the task storages */ public void run() { setup(); log.info("start recovering..."); systemAdmins.start(); this.containerStorageManagers.forEach((containerName, containerStorageManager) -> { containerStorageManager.start(); }); this.containerStorageManagers.forEach((containerName, containerStorageManager) -> { containerStorageManager.shutdown(); }); systemAdmins.stop(); log.info("successfully recovered in " + storeBaseDir.toString()); }
@Test public void testParallelismAndMetrics() { this.containerStorageManager.start(); this.containerStorageManager.shutdown(); for (Gauge gauge : taskRestoreMetricGauges.values()) { Assert.assertTrue("Restoration time gauge value should be invoked atleast once", Mockito.mockingDetails(gauge).getInvocations().size() >= 1); } Assert.assertTrue("Store restore count should be 2 because there are 2 tasks", this.storeRestoreCallCount == 2); Assert.assertTrue("systemConsumerCreation count should be 1 (1 consumer per system)", this.systemConsumerCreationCount == 1); Assert.assertTrue("systemConsumerStopCount count should be 1", this.systemConsumerStopCount == 1); Assert.assertTrue("systemConsumerStartCount count should be 1", this.systemConsumerStartCount == 1); } }