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());
}
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);
}
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)));
}
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());
}
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);
}
Aggregations