org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersHeaders Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.taskmanager.TaskManagersHeaders. 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: MetricsAvailabilityITCase.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
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());
}
 
Example #2
Source File: MetricsAvailabilityITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
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());
}
 
Example #3
Source File: MetricsAvailabilityITCase.java    From flink with Apache License 2.0 6 votes vote down vote up
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());
}
 
Example #4
Source File: YARNSessionCapacitySchedulerITCase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static int getNumberOfSlotsPerTaskManager(final String host, final int port) throws Exception {
	final TaskManagersInfo taskManagersInfo = restClient.sendRequest(
		host,
		port,
		TaskManagersHeaders.getInstance()).get();

	return taskManagersInfo.getTaskManagerInfos()
		.stream()
		.map(TaskManagerInfo::getNumberSlots)
		.findFirst()
		.orElse(0);
}
 
Example #5
Source File: YARNSessionCapacitySchedulerITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
private static int getNumberOfSlotsPerTaskManager(final String host, final int port) throws Exception {
	final TaskManagersInfo taskManagersInfo = restClient.sendRequest(
		host,
		port,
		TaskManagersHeaders.getInstance()).get();

	return taskManagersInfo.getTaskManagerInfos()
		.stream()
		.map(TaskManagerInfo::getNumberSlots)
		.findFirst()
		.orElse(0);
}
 
Example #6
Source File: YARNSessionCapacitySchedulerITCase.java    From flink with Apache License 2.0 5 votes vote down vote up
private static int getNumberOfSlotsPerTaskManager(final String host, final int port) throws Exception {
	final TaskManagersInfo taskManagersInfo = restClient.sendRequest(
		host,
		port,
		TaskManagersHeaders.getInstance()).get();

	return taskManagersInfo.getTaskManagerInfos()
		.stream()
		.map(TaskManagerInfo::getNumberSlots)
		.findFirst()
		.orElse(0);
}