Java Code Examples for org.apache.flink.runtime.messages.webmonitor.JobsOverview#create()

The following examples show how to use org.apache.flink.runtime.messages.webmonitor.JobsOverview#create() . 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: FileArchivedExecutionGraphStoreTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Tests that we obtain the correct jobs overview.
 */
@Test
public void testStoredJobsOverview() throws IOException {
	final int numberExecutionGraphs = 10;
	final Collection<ArchivedExecutionGraph> executionGraphs = generateTerminalExecutionGraphs(numberExecutionGraphs);

	final List<JobStatus> jobStatuses = executionGraphs.stream().map(ArchivedExecutionGraph::getState).collect(Collectors.toList());

	final JobsOverview expectedJobsOverview = JobsOverview.create(jobStatuses);

	final File rootDir = temporaryFolder.newFolder();

	try (final FileArchivedExecutionGraphStore executionGraphStore = createDefaultExecutionGraphStore(rootDir)) {
		for (ArchivedExecutionGraph executionGraph : executionGraphs) {
			executionGraphStore.put(executionGraph);
		}

		assertThat(executionGraphStore.getStoredJobsOverview(), Matchers.equalTo(expectedJobsOverview));
	}
}
 
Example 2
Source File: FileArchivedExecutionGraphStoreTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Tests that we obtain the correct jobs overview.
 */
@Test
public void testStoredJobsOverview() throws IOException {
	final int numberExecutionGraphs = 10;
	final Collection<ArchivedExecutionGraph> executionGraphs = generateTerminalExecutionGraphs(numberExecutionGraphs);

	final List<JobStatus> jobStatuses = executionGraphs.stream().map(ArchivedExecutionGraph::getState).collect(Collectors.toList());

	final JobsOverview expectedJobsOverview = JobsOverview.create(jobStatuses);

	final File rootDir = temporaryFolder.newFolder();

	try (final FileArchivedExecutionGraphStore executionGraphStore = createDefaultExecutionGraphStore(rootDir)) {
		for (ArchivedExecutionGraph executionGraph : executionGraphs) {
			executionGraphStore.put(executionGraph);
		}

		assertThat(executionGraphStore.getStoredJobsOverview(), Matchers.equalTo(expectedJobsOverview));
	}
}
 
Example 3
Source File: FileArchivedExecutionGraphStoreTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Tests that we obtain the correct jobs overview.
 */
@Test
public void testStoredJobsOverview() throws IOException {
	final int numberExecutionGraphs = 10;
	final Collection<ArchivedExecutionGraph> executionGraphs = generateTerminalExecutionGraphs(numberExecutionGraphs);

	final List<JobStatus> jobStatuses = executionGraphs.stream().map(ArchivedExecutionGraph::getState).collect(Collectors.toList());

	final JobsOverview expectedJobsOverview = JobsOverview.create(jobStatuses);

	final File rootDir = temporaryFolder.newFolder();

	try (final FileArchivedExecutionGraphStore executionGraphStore = createDefaultExecutionGraphStore(rootDir)) {
		for (ArchivedExecutionGraph executionGraph : executionGraphs) {
			executionGraphStore.put(executionGraph);
		}

		assertThat(executionGraphStore.getStoredJobsOverview(), Matchers.equalTo(expectedJobsOverview));
	}
}
 
Example 4
Source File: MemoryArchivedExecutionGraphStore.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public JobsOverview getStoredJobsOverview() {
	Collection<JobStatus> allJobStatus = serializableExecutionGraphs.values().stream()
		.map(ArchivedExecutionGraph::getState)
		.collect(Collectors.toList());

	return JobsOverview.create(allJobStatus);
}
 
Example 5
Source File: MemoryArchivedExecutionGraphStore.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public JobsOverview getStoredJobsOverview() {
	Collection<JobStatus> allJobStatus = serializableExecutionGraphs.values().stream()
		.map(ArchivedExecutionGraph::getState)
		.collect(Collectors.toList());

	return JobsOverview.create(allJobStatus);
}
 
Example 6
Source File: MemoryArchivedExecutionGraphStore.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public JobsOverview getStoredJobsOverview() {
	Collection<JobStatus> allJobStatus = serializableExecutionGraphs.values().stream()
		.map(ArchivedExecutionGraph::getState)
		.collect(Collectors.toList());

	return JobsOverview.create(allJobStatus);
}