Search in sources :

Example 1 with JobMessageParameters

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

the class JobExecutionResultHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    final TestingRestfulGateway testingRestfulGateway = new TestingRestfulGateway.Builder().build();
    jobExecutionResultHandler = new JobExecutionResultHandler(() -> CompletableFuture.completedFuture(testingRestfulGateway), Time.seconds(10), Collections.emptyMap());
    testRequest = HandlerRequest.resolveParametersAndCreate(EmptyRequestBody.getInstance(), new JobMessageParameters(), Collections.singletonMap("jobid", TEST_JOB_ID.toString()), Collections.emptyMap(), Collections.emptyList());
}
Also used : TestingRestfulGateway(org.apache.flink.runtime.webmonitor.TestingRestfulGateway) JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters) Before(org.junit.Before)

Example 2 with JobMessageParameters

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

the class MetricQuerier method getJobDetails.

public static JobDetailsInfo getJobDetails(RestClient client, TestEnvironment.Endpoint endpoint, JobID jobId) throws Exception {
    String jmAddress = endpoint.getAddress();
    int jmPort = endpoint.getPort();
    final JobMessageParameters params = new JobMessageParameters();
    params.jobPathParameter.resolve(jobId);
    return client.sendRequest(jmAddress, jmPort, JobDetailsHeaders.getInstance(), params, EmptyRequestBody.getInstance()).get(30, TimeUnit.SECONDS);
}
Also used : JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters)

Example 3 with JobMessageParameters

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

the class SavepointITCase method waitUntilAllTasksAreRunning.

public static void waitUntilAllTasksAreRunning(RestClusterClient<?> restClusterClient, JobID jobId) throws Exception {
    // access the REST endpoint of the cluster to determine the state of each
    // ExecutionVertex
    final JobDetailsHeaders detailsHeaders = JobDetailsHeaders.getInstance();
    final JobMessageParameters params = detailsHeaders.getUnresolvedMessageParameters();
    params.jobPathParameter.resolve(jobId);
    CommonTestUtils.waitUntilCondition(() -> restClusterClient.sendRequest(detailsHeaders, params, EmptyRequestBody.getInstance()).thenApply(detailsInfo -> allVerticesRunning(detailsInfo.getJobVerticesPerState())).get(), Deadline.fromNow(Duration.ofSeconds(10)));
}
Also used : JobDetailsHeaders(org.apache.flink.runtime.rest.messages.job.JobDetailsHeaders) JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters)

Example 4 with JobMessageParameters

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

the class JobConfigHandlerTest method createRequest.

private HandlerRequest<EmptyRequestBody> createRequest(JobID jobId) throws HandlerRequestException {
    final Map<String, String> pathParameters = new HashMap<>();
    pathParameters.put(JobIDPathParameter.KEY, jobId.toString());
    return HandlerRequest.resolveParametersAndCreate(EmptyRequestBody.getInstance(), new JobMessageParameters(), pathParameters, Collections.emptyMap(), Collections.emptyList());
}
Also used : HashMap(java.util.HashMap) JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters)

Example 5 with JobMessageParameters

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

the class RestClusterClient method getJobDetails.

/**
 * Requests the job details.
 *
 * @param jobId The job id
 * @return Job details
 */
public CompletableFuture<JobDetailsInfo> getJobDetails(JobID jobId) {
    final JobDetailsHeaders detailsHeaders = JobDetailsHeaders.getInstance();
    final JobMessageParameters params = new JobMessageParameters();
    params.jobPathParameter.resolve(jobId);
    return sendRequest(detailsHeaders, params);
}
Also used : JobDetailsHeaders(org.apache.flink.runtime.rest.messages.job.JobDetailsHeaders) 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