org.apache.flink.runtime.rest.messages.JobVertexBackPressureInfo.VertexBackPressureStatus Java Examples
The following examples show how to use
org.apache.flink.runtime.rest.messages.JobVertexBackPressureInfo.VertexBackPressureStatus.
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: JobVertexBackPressureHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testAbsentBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.DEPRECATED)); }
Example #2
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testAbsentBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.DEPRECATED)); }
Example #3
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testAbsentBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.DEPRECATED)); }
Example #4
Source File: JobVertexBackPressureHandlerTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testGetBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.OK)); assertThat(jobVertexBackPressureInfo.getBackpressureLevel(), equalTo(HIGH)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getRatio) .collect(Collectors.toList()), contains(1.0, 0.5, 0.1)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getBackpressureLevel) .collect(Collectors.toList()), contains(HIGH, LOW, OK)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getSubtask) .collect(Collectors.toList()), contains(0, 1, 2)); }
Example #5
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGetBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.OK)); assertThat(jobVertexBackPressureInfo.getBackpressureLevel(), equalTo(HIGH)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getRatio) .collect(Collectors.toList()), contains(1.0, 0.5, 0.1)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getBackpressureLevel) .collect(Collectors.toList()), contains(HIGH, LOW, OK)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getSubtask) .collect(Collectors.toList()), contains(0, 1, 2)); }
Example #6
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGetBackPressure() throws Exception { final Map<String, String> pathParameters = new HashMap<>(); pathParameters.put(JobIDPathParameter.KEY, TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE.toString()); pathParameters.put(JobVertexIdPathParameter.KEY, new JobVertexID().toString()); final HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request = new HandlerRequest<>( EmptyRequestBody.getInstance(), new JobVertexMessageParameters(), pathParameters, Collections.emptyMap()); final CompletableFuture<JobVertexBackPressureInfo> jobVertexBackPressureInfoCompletableFuture = jobVertexBackPressureHandler.handleRequest(request, restfulGateway); final JobVertexBackPressureInfo jobVertexBackPressureInfo = jobVertexBackPressureInfoCompletableFuture.get(); assertThat(jobVertexBackPressureInfo.getStatus(), equalTo(VertexBackPressureStatus.OK)); assertThat(jobVertexBackPressureInfo.getBackpressureLevel(), equalTo(HIGH)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getRatio) .collect(Collectors.toList()), contains(1.0, 0.5, 0.1)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getBackpressureLevel) .collect(Collectors.toList()), contains(HIGH, LOW, OK)); assertThat(jobVertexBackPressureInfo.getSubtasks() .stream() .map(JobVertexBackPressureInfo.SubtaskBackPressureInfo::getSubtask) .collect(Collectors.toList()), contains(0, 1, 2)); }