@AfterClass public static void shutDownExistingCluster() { if (cluster != null) { cluster.after(); cluster = null; } }
@After public void tearDown() { if (cluster != null) { cluster.after(); } }
@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() + "."); }
@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(); }
private String submitJobAndTakeSavepoint(MiniClusterResourceFactory clusterFactory, int parallelism) throws Exception { final JobGraph jobGraph = createJobGraph(parallelism, 0, 1000); final JobID jobId = jobGraph.getJobID(); StatefulCounter.resetForTest(parallelism); MiniClusterWithClientResource cluster = clusterFactory.get(); cluster.before(); ClusterClient<?> client = cluster.getClusterClient(); try { client.setDetached(true); client.submitJob(jobGraph, SavepointITCase.class.getClassLoader()); StatefulCounter.getProgressLatch().await(); return client.triggerSavepoint(jobId, null).get(); } finally { cluster.after(); StatefulCounter.resetForTest(parallelism); } }
parallelism); } finally { cluster.after();
cluster.after();
cluster.after(); StatefulCounter.resetForTest(parallelism);
@Test public void testTriggerSavepointForNonExistingJob() throws Exception { // Config final int numTaskManagers = 1; final int numSlotsPerTaskManager = 1; final Configuration config = new Configuration(); config.setString(CheckpointingOptions.SAVEPOINT_DIRECTORY, savepointDir.toURI().toString()); final MiniClusterWithClientResource cluster = new MiniClusterWithClientResource( new MiniClusterResourceConfiguration.Builder() .setConfiguration(config) .setNumberTaskManagers(numTaskManagers) .setNumberSlotsPerTaskManager(numSlotsPerTaskManager) .build()); cluster.before(); final ClusterClient<?> client = cluster.getClusterClient(); final JobID jobID = new JobID(); try { client.triggerSavepoint(jobID, null).get(); fail(); } catch (ExecutionException e) { assertTrue(ExceptionUtils.findThrowable(e, FlinkJobNotFoundException.class).isPresent()); assertTrue(ExceptionUtils.findThrowableWithMessage(e, jobID.toString()).isPresent()); } finally { cluster.after(); } }
cluster.after();
assertNotNull(thirdExternalCheckpoint); } finally { cluster.after();
assertTrue(ExceptionUtils.findThrowableWithMessage(e, "is not a streaming job").isPresent()); } finally { cluster.after();
@Test public void testNettyEpoll() throws Exception { MiniClusterWithClientResource cluster = trySetUpCluster(); try { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(NUM_TASK_MANAGERS); env.getConfig().disableSysoutLogging(); DataStream<Integer> input = env.fromElements(1, 2, 3, 4, 1, 2, 3, 42); input.keyBy(new KeySelector<Integer, Integer>() { @Override public Integer getKey(Integer value) throws Exception { return value; } }) .sum(0) .print(); env.execute(); } finally { cluster.after(); } }
client.disposeSavepoint(savepointPath); cluster.after();