org.apache.flink.runtime.rest.messages.JobVertexBackPressureHeaders Java Examples
The following examples show how to use
org.apache.flink.runtime.rest.messages.JobVertexBackPressureHeaders.
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 |
@Before public void setUp() { restfulGateway = TestingRestfulGateway.newBuilder().setRequestOperatorBackPressureStatsFunction( (jobId, jobVertexId) -> { if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(new OperatorBackPressureStats( 4711, Integer.MAX_VALUE, new double[]{1.0, 0.5, 0.1} ))); } else if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(null)); } else { throw new AssertionError(); } } ).build(); jobVertexBackPressureHandler = new JobVertexBackPressureHandler( () -> CompletableFuture.completedFuture(restfulGateway), Time.seconds(10), Collections.emptyMap(), JobVertexBackPressureHeaders.getInstance() ); }
Example #2
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@Before public void setUp() { restfulGateway = TestingRestfulGateway.newBuilder().setRequestOperatorBackPressureStatsFunction( (jobId, jobVertexId) -> { if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(new OperatorBackPressureStats( 4711, Integer.MAX_VALUE, new double[]{1.0, 0.5, 0.1} ))); } else if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(null)); } else { throw new AssertionError(); } } ).build(); jobVertexBackPressureHandler = new JobVertexBackPressureHandler( () -> CompletableFuture.completedFuture(restfulGateway), Time.seconds(10), Collections.emptyMap(), JobVertexBackPressureHeaders.getInstance() ); }
Example #3
Source File: JobVertexBackPressureHandlerTest.java From flink with Apache License 2.0 | 6 votes |
@Before public void setUp() { restfulGateway = new TestingRestfulGateway.Builder().setRequestOperatorBackPressureStatsFunction( (jobId, jobVertexId) -> { if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_AVAILABLE)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(new OperatorBackPressureStats( 4711, Integer.MAX_VALUE, new double[]{1.0, 0.5, 0.1} ))); } else if (jobId.equals(TEST_JOB_ID_BACK_PRESSURE_STATS_ABSENT)) { return CompletableFuture.completedFuture(OperatorBackPressureStatsResponse.of(null)); } else { throw new AssertionError(); } } ).build(); jobVertexBackPressureHandler = new JobVertexBackPressureHandler( () -> CompletableFuture.completedFuture(restfulGateway), Time.seconds(10), Collections.emptyMap(), JobVertexBackPressureHeaders.getInstance() ); }