Search in sources :

Example 1 with TaskManagersHeaders

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

the class MetricsAvailabilityITCase method getTaskManagerIds.

private static Collection<ResourceID> getTaskManagerIds(final RestClient restClient) throws Exception {
    final TaskManagersHeaders headers = TaskManagersHeaders.getInstance();
    final TaskManagersInfo response = fetchMetric(() -> restClient.sendRequest(HOST, PORT, headers, EmptyMessageParameters.getInstance(), EmptyRequestBody.getInstance()), taskManagersInfo -> !taskManagersInfo.getTaskManagerInfos().isEmpty());
    return response.getTaskManagerInfos().stream().map(TaskManagerInfo::getResourceId).collect(Collectors.toList());
}
Also used : TaskManagersHeaders(org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersHeaders) TaskManagersInfo(org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersInfo)

Aggregations

TaskManagersHeaders (org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersHeaders)1 TaskManagersInfo (org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersInfo)1