test_class.file: flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JobVertexCheckpointsHandlerTest.java
test_class.identifier: JobVertexCheckpointsHandlerTest
test_case.body: @Test
  	public void testNoCoordinator() throws Exception {
  		JobVertexCheckpointsHandler handler = new JobVertexCheckpointsHandler(
  				mock(ExecutionGraphHolder.class));
  
  		ExecutionGraph graph = mock(ExecutionGraph.class);
  		ExecutionJobVertex vertex = mock(ExecutionJobVertex.class);
  
  		when(vertex.getGraph()).thenReturn(graph);
  
  		String response = handler.handleRequest(vertex, Collections.<String, String>emptyMap());
  
  		// Expecting empty response
  		assertEquals("{}", response);
  	}
test_case.class_method_signature: JobVertexCheckpointsHandlerTest.testNoCoordinator()
test_case.full_signature: @Test public void testNoCoordinator()
test_case.identifier: testNoCoordinator
test_case.invocations: mock mock mock thenReturn when getGraph handleRequest emptyMap assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoCoordinator()
focal_class.file: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobVertexCheckpointsHandler.java
focal_class.identifier: JobVertexCheckpointsHandler
focal_class.class_method_signature: JobVertexCheckpointsHandler.JobVertexCheckpointsHandler(ExecutionGraphHolder executionGraphHolder)
focal_class.full_signature: public  JobVertexCheckpointsHandler(ExecutionGraphHolder executionGraphHolder)
focal_class.identifier: JobVertexCheckpointsHandler
focal_class.modifiers: public
focal_class.parameters: (ExecutionGraphHolder executionGraphHolder)
focal_class.signature:  JobVertexCheckpointsHandler(ExecutionGraphHolder executionGraphHolder)
focal_class.class_method_signature: JobVertexCheckpointsHandler.handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)
focal_class.full_signature: @Override public String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)
focal_class.identifier: handleRequest
focal_class.modifiers: @Override public
focal_class.parameters: (ExecutionJobVertex jobVertex, Map<String, String> params)
focal_class.return: String
focal_class.signature: String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)
focal_class.superclass: extends AbstractJobVertexRequestHandler
focal_method.body: @Override
  	public String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params) throws Exception {
  		StringWriter writer = new StringWriter();
  		JsonGenerator gen = JsonFactory.jacksonFactory.createGenerator(writer);
  		gen.writeStartObject();
  
  		CheckpointStatsTracker tracker = jobVertex.getGraph().getCheckpointStatsTracker();
  
  		if (tracker != null) {
  			Option<OperatorCheckpointStats> statsOption = tracker
  					.getOperatorStats(jobVertex.getJobVertexId());
  
  			if (statsOption.isDefined()) {
  				OperatorCheckpointStats stats = statsOption.get();
  
  				gen.writeNumberField("id", stats.getCheckpointId());
  				gen.writeNumberField("timestamp", stats.getTriggerTimestamp());
  				gen.writeNumberField("duration", stats.getDuration());
  				gen.writeNumberField("size", stats.getStateSize());
  				gen.writeNumberField("parallelism", stats.getNumberOfSubTasks());
  
  				gen.writeArrayFieldStart("subtasks");
  				for (int i = 0; i < stats.getNumberOfSubTasks(); i++) {
  					gen.writeStartObject();
  					gen.writeNumberField("subtask", i);
  					gen.writeNumberField("duration", stats.getSubTaskDuration(i));
  					gen.writeNumberField("size", stats.getSubTaskStateSize(i));
  					gen.writeEndObject();
  				}
  				gen.writeEndArray();
  			}
  		}
  
  		gen.writeEndObject();
  		gen.close();
  
  		return writer.toString();
  	}
focal_method.class_method_signature: JobVertexCheckpointsHandler.handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)
focal_method.full_signature: @Override public String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)
focal_method.identifier: handleRequest
focal_method.invocations: createGenerator writeStartObject getCheckpointStatsTracker getGraph getOperatorStats getJobVertexId isDefined get writeNumberField getCheckpointId writeNumberField getTriggerTimestamp writeNumberField getDuration writeNumberField getStateSize writeNumberField getNumberOfSubTasks writeArrayFieldStart getNumberOfSubTasks writeStartObject writeNumberField writeNumberField getSubTaskDuration writeNumberField getSubTaskStateSize writeEndObject writeEndArray writeEndObject close toString
focal_method.modifiers: @Override public
focal_method.parameters: (ExecutionJobVertex jobVertex, Map<String, String> params)
focal_method.return: String
focal_method.signature: String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> params)