org.apache.flink.runtime.rest.messages.checkpoints.SubtaskCheckpointStatistics Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.checkpoints.SubtaskCheckpointStatistics. 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: TaskCheckpointStatisticDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails createCheckpointDetails(AbstractCheckpointStats checkpointStats, TaskStateStats taskStatistics) {
	final TaskCheckpointStatisticsWithSubtaskDetails.Summary summary = createSummary(
		taskStatistics.getSummaryStats(),
		checkpointStats.getTriggerTimestamp());

	final List<SubtaskCheckpointStatistics> subtaskCheckpointStatistics = createSubtaskCheckpointStatistics(
		taskStatistics.getSubtaskStats(),
		checkpointStats.getTriggerTimestamp());

	return new TaskCheckpointStatisticsWithSubtaskDetails(
		checkpointStats.getCheckpointId(),
		checkpointStats.getStatus(),
		taskStatistics.getLatestAckTimestamp(),
		taskStatistics.getStateSize(),
		taskStatistics.getEndToEndDuration(checkpointStats.getTriggerTimestamp()),
		taskStatistics.getAlignmentBuffered(),
		taskStatistics.getNumberOfSubtasks(),
		taskStatistics.getNumberOfAcknowledgedSubtasks(),
		summary,
		subtaskCheckpointStatistics);
}
 
Example #2
Source File: TaskCheckpointStatisticDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private static List<SubtaskCheckpointStatistics> createSubtaskCheckpointStatistics(SubtaskStateStats[] subtaskStateStats, long triggerTimestamp) {
	final List<SubtaskCheckpointStatistics> result = new ArrayList<>(subtaskStateStats.length);

	for (int i = 0; i < subtaskStateStats.length; i++) {
		final SubtaskStateStats subtask = subtaskStateStats[i];

		if (subtask == null) {
			result.add(new SubtaskCheckpointStatistics.PendingSubtaskCheckpointStatistics(i));
		} else {
			result.add(new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics(
				i,
				subtask.getAckTimestamp(),
				subtask.getEndToEndDuration(triggerTimestamp),
				subtask.getStateSize(),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointDuration(
					subtask.getSyncCheckpointDuration(),
					subtask.getAsyncCheckpointDuration()),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointAlignment(
					subtask.getAlignmentBuffered(),
					subtask.getAlignmentDuration())
			));
		}
	}

	return result;
}
 
Example #3
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails createCheckpointDetails(AbstractCheckpointStats checkpointStats, TaskStateStats taskStatistics) {
	final TaskCheckpointStatisticsWithSubtaskDetails.Summary summary = createSummary(
		taskStatistics.getSummaryStats(),
		checkpointStats.getTriggerTimestamp());

	final List<SubtaskCheckpointStatistics> subtaskCheckpointStatistics = createSubtaskCheckpointStatistics(
		taskStatistics.getSubtaskStats(),
		checkpointStats.getTriggerTimestamp());

	return new TaskCheckpointStatisticsWithSubtaskDetails(
		checkpointStats.getCheckpointId(),
		checkpointStats.getStatus(),
		taskStatistics.getLatestAckTimestamp(),
		taskStatistics.getStateSize(),
		taskStatistics.getEndToEndDuration(checkpointStats.getTriggerTimestamp()),
		taskStatistics.getAlignmentBuffered(),
		taskStatistics.getNumberOfSubtasks(),
		taskStatistics.getNumberOfAcknowledgedSubtasks(),
		summary,
		subtaskCheckpointStatistics);
}
 
Example #4
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static List<SubtaskCheckpointStatistics> createSubtaskCheckpointStatistics(SubtaskStateStats[] subtaskStateStats, long triggerTimestamp) {
	final List<SubtaskCheckpointStatistics> result = new ArrayList<>(subtaskStateStats.length);

	for (int i = 0; i < subtaskStateStats.length; i++) {
		final SubtaskStateStats subtask = subtaskStateStats[i];

		if (subtask == null) {
			result.add(new SubtaskCheckpointStatistics.PendingSubtaskCheckpointStatistics(i));
		} else {
			result.add(new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics(
				i,
				subtask.getAckTimestamp(),
				subtask.getEndToEndDuration(triggerTimestamp),
				subtask.getStateSize(),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointDuration(
					subtask.getSyncCheckpointDuration(),
					subtask.getAsyncCheckpointDuration()),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointAlignment(
					subtask.getAlignmentBuffered(),
					subtask.getAlignmentDuration())
			));
		}
	}

	return result;
}
 
Example #5
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails createCheckpointDetails(AbstractCheckpointStats checkpointStats, TaskStateStats taskStatistics) {
	final TaskCheckpointStatisticsWithSubtaskDetails.Summary summary = createSummary(
		taskStatistics.getSummaryStats(),
		checkpointStats.getTriggerTimestamp());

	final List<SubtaskCheckpointStatistics> subtaskCheckpointStatistics = createSubtaskCheckpointStatistics(
		taskStatistics.getSubtaskStats(),
		checkpointStats.getTriggerTimestamp());

	return new TaskCheckpointStatisticsWithSubtaskDetails(
		checkpointStats.getCheckpointId(),
		checkpointStats.getStatus(),
		taskStatistics.getLatestAckTimestamp(),
		taskStatistics.getStateSize(),
		taskStatistics.getEndToEndDuration(checkpointStats.getTriggerTimestamp()),
		0,
		taskStatistics.getNumberOfSubtasks(),
		taskStatistics.getNumberOfAcknowledgedSubtasks(),
		summary,
		subtaskCheckpointStatistics);
}
 
Example #6
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
private static List<SubtaskCheckpointStatistics> createSubtaskCheckpointStatistics(SubtaskStateStats[] subtaskStateStats, long triggerTimestamp) {
	final List<SubtaskCheckpointStatistics> result = new ArrayList<>(subtaskStateStats.length);

	for (int i = 0; i < subtaskStateStats.length; i++) {
		final SubtaskStateStats subtask = subtaskStateStats[i];

		if (subtask == null) {
			result.add(new SubtaskCheckpointStatistics.PendingSubtaskCheckpointStatistics(i));
		} else {
			result.add(new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics(
				i,
				subtask.getAckTimestamp(),
				subtask.getEndToEndDuration(triggerTimestamp),
				subtask.getStateSize(),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointDuration(
					subtask.getSyncCheckpointDuration(),
					subtask.getAsyncCheckpointDuration()),
				new SubtaskCheckpointStatistics.CompletedSubtaskCheckpointStatistics.CheckpointAlignment(
					0,
					subtask.getAlignmentDuration()),
				subtask.getCheckpointStartDelay()
			));
		}
	}

	return result;
}