@Override public void stop() throws InterruptedException { try { server.stop(); } catch (IOException e) { throw new RuntimeException(e); } }
@AfterClass public static void teardown() throws Exception { if (zkServer != null) { zkServer.stop(); zkServer = null; } }
TestingServer zkTestServer; @Before public void startZookeeper() throws Exception { zkTestServer = new TestingServer(2181); cli = CuratorFrameworkFactory.newClient(zkTestServer.getConnectString(), new RetryOneTime(2000)); } @After public void stopZookeeper() throws IOException { cli.close(); zkTestServer.stop(); }
zookeeper.stop();
@After public void stopTestCluster() throws IOException { if (miniClusterResource != null) { miniClusterResource.after(); miniClusterResource = null; } if (zkServer != null) { zkServer.stop(); zkServer = null; } //Prints a message when finishing a test method to avoid Travis' <tt>"Maven produced no output // for xxx seconds."</tt> messages. System.out.println( "Finished " + getClass().getCanonicalName() + "#" + name.getMethodName() + "."); }
zookeeper.stop();
zookeeper.stop();
zookeeper.stop(); zookeeper.close();
@AfterClass public static void tearDown() throws Exception { miniClusterResource.after(); zkServer.stop(); zkServer.close(); }
@AfterClass public static void tearDown() throws Exception { miniClusterResource.after(); client.shutdownAndWait(); zkServer.stop(); zkServer.close(); }
@AfterClass public static void tearDown() throws Exception { miniClusterResource.after(); client.shutdownAndWait(); zkServer.stop(); zkServer.close(); }
server.stop(); Assert.assertTrue(timing.awaitLatch(latch));
@Test public void testExternalizedFSCheckpointsWithLocalRecoveryZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createFsStateBackend(checkpointDir), true); } finally { zkServer.stop(); } }
@Test public void testExternalizedIncrementalRocksDBCheckpointsZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createRocksDBStateBackend(checkpointDir, true), false); } finally { zkServer.stop(); } }
@Test public void testExternalizedFullRocksDBCheckpointsWithLocalRecoveryZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createRocksDBStateBackend(checkpointDir, false), true); } finally { zkServer.stop(); } }
@Test public void testExternalizedFullRocksDBCheckpointsZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createRocksDBStateBackend(checkpointDir, false), false); } finally { zkServer.stop(); } }
@Test public void testExternalizedIncrementalRocksDBCheckpointsWithLocalRecoveryZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createRocksDBStateBackend(checkpointDir, true), true); } finally { zkServer.stop(); } }
@Test public void testExternalizedFSCheckpointsZookeeper() throws Exception { TestingServer zkServer = new TestingServer(); zkServer.start(); try { final File checkpointDir = temporaryFolder.newFolder(); testExternalizedCheckpoints( checkpointDir, zkServer.getConnectString(), createFsStateBackend(checkpointDir), false); } finally { zkServer.stop(); } }
/** * Basic setup: start a ZK and verify that the initial endpoint list is empty. * Also validates the basics of the test setup (mock server, etc.) * * @throws Exception */ @Test public void testBasics() throws Exception { try (TestingServer server = new TestingServer()) { server.start(); String connStr = server.getConnectString(); ZKClusterCoordinatorDriver driver = new ZKClusterCoordinatorDriver() .setConnect(connStr, "drill", "drillbits").build(); assertTrue(driver.getInitialEndpoints().isEmpty()); driver.close(); server.stop(); } }
Await.ready(system.whenTerminated(), Duration.Inf()); testingServer.stop(); testingServer.close();