use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.
the class CurrentJobsOverviewHandlerTest method testArchiver.
@Test
public void testArchiver() throws Exception {
JsonArchivist archivist = new CurrentJobsOverviewHandler.CurrentJobsOverviewJsonArchivist();
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
JobDetails expectedDetails = WebMonitorUtils.createDetailsForJob(originalJob);
Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
Assert.assertEquals(1, archives.size());
ArchivedJson archive = archives.iterator().next();
Assert.assertEquals("/joboverview", archive.getPath());
JsonNode result = ArchivedJobGenerationUtils.mapper.readTree(archive.getJson());
ArrayNode running = (ArrayNode) result.get("running");
Assert.assertEquals(0, running.size());
ArrayNode finished = (ArrayNode) result.get("finished");
Assert.assertEquals(1, finished.size());
compareJobOverview(expectedDetails, finished.get(0).toString());
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.
the class CurrentJobsOverviewHandlerTest method testJsonGeneration.
@Test
public void testJsonGeneration() throws Exception {
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
JobDetails expectedDetails = WebMonitorUtils.createDetailsForJob(originalJob);
StringWriter writer = new StringWriter();
try (JsonGenerator gen = ArchivedJobGenerationUtils.jacksonFactory.createGenerator(writer)) {
CurrentJobsOverviewHandler.writeJobDetailOverviewAsJson(expectedDetails, gen, 0);
}
compareJobOverview(expectedDetails, writer.toString());
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.
the class SubtaskExecutionAttemptAccumulatorsHandlerTest method testArchiver.
@Test
public void testArchiver() throws Exception {
JsonArchivist archivist = new SubtaskExecutionAttemptAccumulatorsHandler.SubtaskExecutionAttemptAccumulatorsJsonArchivist();
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
AccessExecution originalAttempt = ArchivedJobGenerationUtils.getTestAttempt();
Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
Assert.assertEquals(1, archives.size());
ArchivedJson archive = archives.iterator().next();
Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/" + originalAttempt.getParallelSubtaskIndex() + "/attempts/" + originalAttempt.getAttemptNumber() + "/accumulators", archive.getPath());
compareAttemptAccumulators(originalAttempt, archive.getJson());
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.
the class SubtaskExecutionAttemptDetailsHandlerTest method testJsonGeneration.
@Test
public void testJsonGeneration() throws Exception {
AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
AccessExecution originalAttempt = ArchivedJobGenerationUtils.getTestAttempt();
String json = SubtaskExecutionAttemptDetailsHandler.createAttemptDetailsJson(originalAttempt, originalJob.getJobID().toString(), originalTask.getJobVertexId().toString(), null);
compareAttemptDetails(originalAttempt, json);
}
use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.
the class CheckpointConfigHandlerTest method createGraphAndSettings.
private static GraphAndSettings createGraphAndSettings(boolean externalized, boolean exactlyOnce) {
long interval = 18231823L;
long timeout = 996979L;
long minPause = 119191919L;
int maxConcurrent = 12929329;
ExternalizedCheckpointSettings externalizedSetting = externalized ? ExternalizedCheckpointSettings.externalizeCheckpoints(true) : ExternalizedCheckpointSettings.none();
JobSnapshottingSettings settings = new JobSnapshottingSettings(Collections.<JobVertexID>emptyList(), Collections.<JobVertexID>emptyList(), Collections.<JobVertexID>emptyList(), interval, timeout, minPause, maxConcurrent, externalizedSetting, null, exactlyOnce);
AccessExecutionGraph graph = mock(AccessExecutionGraph.class);
when(graph.getJobSnapshottingSettings()).thenReturn(settings);
return new GraphAndSettings(graph, settings, externalizedSetting);
}
Aggregations