org.apache.flink.runtime.rest.messages.JobVertexDetailsInfo Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.JobVertexDetailsInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobVertexDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JobVertexDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobVertexDetailsInfo, JobVertexMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		MetricFetcher metricFetcher) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
	this.metricFetcher = metricFetcher;
}
 
Example #2
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobVertexDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobVertexDetailsInfo, JobVertexMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		MetricFetcher metricFetcher) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
	this.metricFetcher = metricFetcher;
}
 
Example #3
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JobVertexDetailsHandler(
		GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		Time timeout,
		Map<String, String> responseHeaders,
		MessageHeaders<EmptyRequestBody, JobVertexDetailsInfo, JobVertexMessageParameters> messageHeaders,
		ExecutionGraphCache executionGraphCache,
		Executor executor,
		MetricFetcher metricFetcher) {
	super(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		executionGraphCache,
		executor);
	this.metricFetcher = metricFetcher;
}
 
Example #4
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static JobVertexDetailsInfo createJobVertexDetailsInfo(AccessExecutionJobVertex jobVertex, JobID jobID, @Nullable MetricFetcher metricFetcher) {
	List<SubtaskExecutionAttemptDetailsInfo> subtasks = new ArrayList<>();
	final long now = System.currentTimeMillis();
	for (AccessExecutionVertex vertex : jobVertex.getTaskVertices()) {
		final AccessExecution execution = vertex.getCurrentExecutionAttempt();
		final JobVertexID jobVertexID = jobVertex.getJobVertexId();
		subtasks.add(SubtaskExecutionAttemptDetailsInfo.create(execution, metricFetcher, jobID, jobVertexID));
	}

	return new JobVertexDetailsInfo(
		jobVertex.getJobVertexId(),
		jobVertex.getName(),
		jobVertex.getParallelism(),
		now,
		subtasks);
}
 
Example #5
Source File: JobVertexDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected JobVertexDetailsInfo handleRequest(
		HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request,
		AccessExecutionGraph executionGraph) throws NotFoundException {
	JobID jobID = request.getPathParameter(JobIDPathParameter.class);
	JobVertexID jobVertexID = request.getPathParameter(JobVertexIdPathParameter.class);
	AccessExecutionJobVertex jobVertex = executionGraph.getJobVertex(jobVertexID);

	if (jobVertex == null) {
		throw new NotFoundException(String.format("JobVertex %s not found", jobVertexID));
	}

	return createJobVertexDetailsInfo(jobVertex, jobID, metricFetcher);
}
 
Example #6
Source File: BatchFineGrainedRecoveryITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
private JobVertexDetailsInfo getJobVertexDetailsInfo(JobID jobId, JobVertexID jobVertexID) {
	JobVertexDetailsHeaders detailsHeaders = JobVertexDetailsHeaders.getInstance();
	JobVertexMessageParameters params = new JobVertexMessageParameters();
	params.jobPathParameter.resolve(jobId);
	params.jobVertexIdPathParameter.resolve(jobVertexID);
	return sendRequest(detailsHeaders, params).join();
}
 
Example #7
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected JobVertexDetailsInfo handleRequest(
		HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request,
		AccessExecutionGraph executionGraph) throws NotFoundException {
	JobID jobID = request.getPathParameter(JobIDPathParameter.class);
	JobVertexID jobVertexID = request.getPathParameter(JobVertexIdPathParameter.class);
	AccessExecutionJobVertex jobVertex = executionGraph.getJobVertex(jobVertexID);

	if (jobVertex == null) {
		throw new NotFoundException(String.format("JobVertex %s not found", jobVertexID));
	}

	return createJobVertexDetailsInfo(jobVertex, jobID, metricFetcher);
}
 
Example #8
Source File: BatchFineGrainedRecoveryITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
private JobVertexDetailsInfo getJobVertexDetailsInfo(JobID jobId, JobVertexID jobVertexID) {
	JobVertexDetailsHeaders detailsHeaders = JobVertexDetailsHeaders.getInstance();
	JobVertexMessageParameters params = new JobVertexMessageParameters();
	params.jobPathParameter.resolve(jobId);
	params.jobVertexIdPathParameter.resolve(jobVertexID);
	return sendRequest(detailsHeaders, params).join();
}
 
Example #9
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected JobVertexDetailsInfo handleRequest(
		HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request,
		AccessExecutionGraph executionGraph) throws NotFoundException {
	JobID jobID = request.getPathParameter(JobIDPathParameter.class);
	JobVertexID jobVertexID = request.getPathParameter(JobVertexIdPathParameter.class);
	AccessExecutionJobVertex jobVertex = executionGraph.getJobVertex(jobVertexID);

	if (jobVertex == null) {
		throw new NotFoundException(String.format("JobVertex %s not found", jobVertexID));
	}

	return createJobVertexDetailsInfo(jobVertex, jobID, metricFetcher);
}
 
Example #10
Source File: JobVertexDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private static JobVertexDetailsInfo createJobVertexDetailsInfo(AccessExecutionJobVertex jobVertex, JobID jobID, @Nullable MetricFetcher metricFetcher) {
	List<JobVertexDetailsInfo.VertexTaskDetail> subtasks = new ArrayList<>();
	final long now = System.currentTimeMillis();
	int num = 0;
	for (AccessExecutionVertex vertex : jobVertex.getTaskVertices()) {
		final ExecutionState status = vertex.getExecutionState();

		TaskManagerLocation location = vertex.getCurrentAssignedResourceLocation();
		String locationString = location == null ? "(unassigned)" : location.getHostname() + ":" + location.dataPort();

		long startTime = vertex.getStateTimestamp(ExecutionState.DEPLOYING);
		if (startTime == 0) {
			startTime = -1;
		}
		long endTime = status.isTerminal() ? vertex.getStateTimestamp(status) : -1;
		long duration = startTime > 0 ? ((endTime > 0 ? endTime : now) - startTime) : -1;

		MutableIOMetrics counts = new MutableIOMetrics();
		counts.addIOMetrics(
			vertex.getCurrentExecutionAttempt(),
			metricFetcher,
			jobID.toString(),
			jobVertex.getJobVertexId().toString());
		subtasks.add(new JobVertexDetailsInfo.VertexTaskDetail(
			num,
			status,
			vertex.getCurrentExecutionAttempt().getAttemptNumber(),
			locationString,
			startTime,
			endTime,
			duration,
			new IOMetricsInfo(
				counts.getNumBytesInLocal() + counts.getNumBytesInRemote(),
				counts.isNumBytesInLocalComplete() && counts.isNumBytesInRemoteComplete(),
				counts.getNumBytesOut(),
				counts.isNumBytesOutComplete(),
				counts.getNumRecordsIn(),
				counts.isNumRecordsInComplete(),
				counts.getNumRecordsOut(),
				counts.isNumRecordsOutComplete())));

		num++;
	}

	return new JobVertexDetailsInfo(
		jobVertex.getJobVertexId(),
		jobVertex.getName(),
		jobVertex.getParallelism(),
		now,
		subtasks);
}
 
Example #11
Source File: JobVertexDetailsHandler.java    From flink with Apache License 2.0 4 votes vote down vote up
private static JobVertexDetailsInfo createJobVertexDetailsInfo(AccessExecutionJobVertex jobVertex, JobID jobID, @Nullable MetricFetcher metricFetcher) {
	List<JobVertexDetailsInfo.VertexTaskDetail> subtasks = new ArrayList<>();
	final long now = System.currentTimeMillis();
	int num = 0;
	for (AccessExecutionVertex vertex : jobVertex.getTaskVertices()) {
		final ExecutionState status = vertex.getExecutionState();

		TaskManagerLocation location = vertex.getCurrentAssignedResourceLocation();
		String locationString = location == null ? "(unassigned)" : location.getHostname() + ":" + location.dataPort();

		long startTime = vertex.getStateTimestamp(ExecutionState.DEPLOYING);
		if (startTime == 0) {
			startTime = -1;
		}
		long endTime = status.isTerminal() ? vertex.getStateTimestamp(status) : -1;
		long duration = startTime > 0 ? ((endTime > 0 ? endTime : now) - startTime) : -1;

		MutableIOMetrics counts = new MutableIOMetrics();
		counts.addIOMetrics(
			vertex.getCurrentExecutionAttempt(),
			metricFetcher,
			jobID.toString(),
			jobVertex.getJobVertexId().toString());
		subtasks.add(new JobVertexDetailsInfo.VertexTaskDetail(
			num,
			status,
			vertex.getCurrentExecutionAttempt().getAttemptNumber(),
			locationString,
			startTime,
			endTime,
			duration,
			new IOMetricsInfo(
				counts.getNumBytesIn(),
				counts.isNumBytesInComplete(),
				counts.getNumBytesOut(),
				counts.isNumBytesOutComplete(),
				counts.getNumRecordsIn(),
				counts.isNumRecordsInComplete(),
				counts.getNumRecordsOut(),
				counts.isNumRecordsOutComplete())));

		num++;
	}

	return new JobVertexDetailsInfo(
		jobVertex.getJobVertexId(),
		jobVertex.getName(),
		jobVertex.getParallelism(),
		now,
		subtasks);
}