Search in sources :

Example 6 with JobMessageParameters

use of org.apache.flink.runtime.rest.messages.JobMessageParameters in project flink by apache.

the class LocalRecoveryITCase method waitUntilCheckpointCompleted.

private void waitUntilCheckpointCompleted(Configuration configuration, int restPort, JobID jobId, Deadline deadline) throws Exception {
    final RestClient restClient = new RestClient(configuration, Executors.directExecutor());
    final JobMessageParameters messageParameters = new JobMessageParameters();
    messageParameters.jobPathParameter.resolve(jobId);
    CommonTestUtils.waitUntilCondition(() -> {
        final CheckpointingStatistics checkpointingStatistics = restClient.sendRequest("localhost", restPort, CheckpointingStatisticsHeaders.getInstance(), messageParameters, EmptyRequestBody.getInstance()).join();
        return checkpointingStatistics.getCounts().getNumberCompletedCheckpoints() > 0;
    }, deadline);
}
Also used : CheckpointingStatistics(org.apache.flink.runtime.rest.messages.checkpoints.CheckpointingStatistics) RestClient(org.apache.flink.runtime.rest.RestClient) JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters)

Aggregations

JobMessageParameters (org.apache.flink.runtime.rest.messages.JobMessageParameters)6 JobDetailsHeaders (org.apache.flink.runtime.rest.messages.job.JobDetailsHeaders)2 HashMap (java.util.HashMap)1 RestClient (org.apache.flink.runtime.rest.RestClient)1 CheckpointingStatistics (org.apache.flink.runtime.rest.messages.checkpoints.CheckpointingStatistics)1 TestingRestfulGateway (org.apache.flink.runtime.webmonitor.TestingRestfulGateway)1 Before (org.junit.Before)1