Search in sources :

Example 36 with AccessExecutionGraph

use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.

the class CheckpointStatsDetailsHandlerTest method testIllegalCheckpointId.

/**
	 * Tests request with illegal checkpoint ID param.
	 */
@Test
public void testIllegalCheckpointId() throws Exception {
    AccessExecutionGraph graph = mock(AccessExecutionGraph.class);
    CheckpointStatsDetailsHandler handler = new CheckpointStatsDetailsHandler(mock(ExecutionGraphHolder.class), new CheckpointStatsCache(0));
    Map<String, String> params = new HashMap<>();
    params.put("checkpointid", "illegal checkpoint");
    String json = handler.handleRequest(graph, params);
    assertEquals("{}", json);
}
Also used : ExecutionGraphHolder(org.apache.flink.runtime.webmonitor.ExecutionGraphHolder) HashMap(java.util.HashMap) AccessExecutionGraph(org.apache.flink.runtime.executiongraph.AccessExecutionGraph) Test(org.junit.Test)

Example 37 with AccessExecutionGraph

use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.

the class JobVertexDetailsHandlerTest method testArchiver.

@Test
public void testArchiver() throws Exception {
    JsonArchivist archivist = new JobVertexDetailsHandler.JobVertexDetailsJsonArchivist();
    AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
    AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
    Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
    Assert.assertEquals(1, archives.size());
    ArchivedJson archive = archives.iterator().next();
    Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId(), archive.getPath());
    compareVertexDetails(originalTask, archive.getJson());
}
Also used : AccessExecutionJobVertex(org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex) JsonArchivist(org.apache.flink.runtime.webmonitor.history.JsonArchivist) ArchivedJson(org.apache.flink.runtime.webmonitor.history.ArchivedJson) AccessExecutionGraph(org.apache.flink.runtime.executiongraph.AccessExecutionGraph) Test(org.junit.Test)

Example 38 with AccessExecutionGraph

use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.

the class JobVertexTaskManagersHandlerTest method testArchiver.

@Test
public void testArchiver() throws Exception {
    JsonArchivist archivist = new JobVertexTaskManagersHandler.JobVertexTaskManagersJsonArchivist();
    AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
    AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
    AccessExecutionVertex originalSubtask = ArchivedJobGenerationUtils.getTestSubtask();
    Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
    Assert.assertEquals(1, archives.size());
    ArchivedJson archive = archives.iterator().next();
    Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/taskmanagers", archive.getPath());
    compareVertexTaskManagers(originalTask, originalSubtask, archive.getJson());
}
Also used : AccessExecutionJobVertex(org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex) JsonArchivist(org.apache.flink.runtime.webmonitor.history.JsonArchivist) ArchivedJson(org.apache.flink.runtime.webmonitor.history.ArchivedJson) AccessExecutionGraph(org.apache.flink.runtime.executiongraph.AccessExecutionGraph) AccessExecutionVertex(org.apache.flink.runtime.executiongraph.AccessExecutionVertex) Test(org.junit.Test)

Example 39 with AccessExecutionGraph

use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.

the class SubtaskExecutionAttemptDetailsHandlerTest method testArchiver.

@Test
public void testArchiver() throws Exception {
    JsonArchivist archivist = new SubtaskExecutionAttemptDetailsHandler.SubtaskExecutionAttemptDetailsJsonArchivist();
    AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
    AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
    AccessExecution originalAttempt = ArchivedJobGenerationUtils.getTestAttempt();
    Collection<ArchivedJson> archives = archivist.archiveJsonWithPath(originalJob);
    Assert.assertEquals(2, archives.size());
    Iterator<ArchivedJson> iterator = archives.iterator();
    ArchivedJson archive1 = iterator.next();
    Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/" + originalAttempt.getParallelSubtaskIndex(), archive1.getPath());
    compareAttemptDetails(originalAttempt, archive1.getJson());
    ArchivedJson archive2 = iterator.next();
    Assert.assertEquals("/jobs/" + originalJob.getJobID() + "/vertices/" + originalTask.getJobVertexId() + "/subtasks/" + originalAttempt.getParallelSubtaskIndex() + "/attempts/" + originalAttempt.getAttemptNumber(), archive2.getPath());
    compareAttemptDetails(originalAttempt, archive2.getJson());
}
Also used : AccessExecutionJobVertex(org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex) JsonArchivist(org.apache.flink.runtime.webmonitor.history.JsonArchivist) AccessExecution(org.apache.flink.runtime.executiongraph.AccessExecution) ArchivedJson(org.apache.flink.runtime.webmonitor.history.ArchivedJson) AccessExecutionGraph(org.apache.flink.runtime.executiongraph.AccessExecutionGraph) Test(org.junit.Test)

Example 40 with AccessExecutionGraph

use of org.apache.flink.runtime.executiongraph.AccessExecutionGraph in project flink by apache.

the class SubtasksAllAccumulatorsHandlerTest method testArchiver.

@Test
public void testArchiver() throws Exception {
    JsonArchivist archivist = new SubtasksAllAccumulatorsHandler.SubtasksAllAccumulatorsJsonArchivist();
    AccessExecutionGraph originalJob = ArchivedJobGenerationUtils.getTestJob();
    AccessExecutionJobVertex originalTask = ArchivedJobGenerationUtils.getTestTask();
    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/accumulators", archive.getPath());
    compareSubtaskAccumulators(originalTask, archive.getJson());
}
Also used : AccessExecutionJobVertex(org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex) JsonArchivist(org.apache.flink.runtime.webmonitor.history.JsonArchivist) ArchivedJson(org.apache.flink.runtime.webmonitor.history.ArchivedJson) AccessExecutionGraph(org.apache.flink.runtime.executiongraph.AccessExecutionGraph) Test(org.junit.Test)

Aggregations

AccessExecutionGraph (org.apache.flink.runtime.executiongraph.AccessExecutionGraph)40 Test (org.junit.Test)33 ArchivedJson (org.apache.flink.runtime.webmonitor.history.ArchivedJson)16 JsonArchivist (org.apache.flink.runtime.webmonitor.history.JsonArchivist)16 ExecutionGraphHolder (org.apache.flink.runtime.webmonitor.ExecutionGraphHolder)14 HashMap (java.util.HashMap)9 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)8 CheckpointStatsHistory (org.apache.flink.runtime.checkpoint.CheckpointStatsHistory)8 CheckpointStatsSnapshot (org.apache.flink.runtime.checkpoint.CheckpointStatsSnapshot)8 AccessExecutionJobVertex (org.apache.flink.runtime.executiongraph.AccessExecutionJobVertex)8 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 JobID (org.apache.flink.api.common.JobID)4 AccessExecution (org.apache.flink.runtime.executiongraph.AccessExecution)4 PendingCheckpointStats (org.apache.flink.runtime.checkpoint.PendingCheckpointStats)3 JobVertexID (org.apache.flink.runtime.jobgraph.JobVertexID)3 ExternalizedCheckpointSettings (org.apache.flink.runtime.jobgraph.tasks.ExternalizedCheckpointSettings)3 JobSnapshottingSettings (org.apache.flink.runtime.jobgraph.tasks.JobSnapshottingSettings)3 ArrayList (java.util.ArrayList)2 AbstractCheckpointStats (org.apache.flink.runtime.checkpoint.AbstractCheckpointStats)2 CompletedCheckpointStats (org.apache.flink.runtime.checkpoint.CompletedCheckpointStats)2