Java Code Examples for org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore#getTaskManagerMetricStore()

The following examples show how to use org.apache.flink.runtime.rest.handler.legacy.metrics.MetricStore#getTaskManagerMetricStore() . 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: AggregatingTaskManagersMetricsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
Collection<? extends MetricStore.ComponentMetricStore> getStores(MetricStore store, HandlerRequest<EmptyRequestBody, AggregateTaskManagerMetricsParameters> request) {
	List<ResourceID> taskmanagers = request.getQueryParameter(TaskManagersFilterQueryParameter.class);
	if (taskmanagers.isEmpty()) {
		return store.getTaskManagers().values();
	} else {
		Collection<MetricStore.TaskManagerMetricStore> taskmanagerStores = new ArrayList<>(taskmanagers.size());
		for (ResourceID taskmanager : taskmanagers) {
			MetricStore.TaskManagerMetricStore taskManagerMetricStore = store.getTaskManagerMetricStore(taskmanager.getResourceIdString());
			if (taskManagerMetricStore != null) {
				taskmanagerStores.add(taskManagerMetricStore);
			}
		}
		return taskmanagerStores;
	}
}
 
Example 2
Source File: AggregatingTaskManagersMetricsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
Collection<? extends MetricStore.ComponentMetricStore> getStores(MetricStore store, HandlerRequest<EmptyRequestBody, AggregateTaskManagerMetricsParameters> request) {
	List<ResourceID> taskmanagers = request.getQueryParameter(TaskManagersFilterQueryParameter.class);
	if (taskmanagers.isEmpty()) {
		return store.getTaskManagers().values();
	} else {
		Collection<MetricStore.TaskManagerMetricStore> taskmanagerStores = new ArrayList<>(taskmanagers.size());
		for (ResourceID taskmanager : taskmanagers) {
			MetricStore.TaskManagerMetricStore taskManagerMetricStore = store.getTaskManagerMetricStore(taskmanager.getResourceIdString());
			if (taskManagerMetricStore != null) {
				taskmanagerStores.add(taskManagerMetricStore);
			}
		}
		return taskmanagerStores;
	}
}
 
Example 3
Source File: AggregatingTaskManagersMetricsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
Collection<? extends MetricStore.ComponentMetricStore> getStores(MetricStore store, HandlerRequest<EmptyRequestBody, AggregateTaskManagerMetricsParameters> request) {
	List<ResourceID> taskmanagers = request.getQueryParameter(TaskManagersFilterQueryParameter.class);
	if (taskmanagers.isEmpty()) {
		return store.getTaskManagers().values();
	} else {
		Collection<MetricStore.TaskManagerMetricStore> taskmanagerStores = new ArrayList<>(taskmanagers.size());
		for (ResourceID taskmanager : taskmanagers) {
			MetricStore.TaskManagerMetricStore taskManagerMetricStore = store.getTaskManagerMetricStore(taskmanager.getResourceIdString());
			if (taskManagerMetricStore != null) {
				taskmanagerStores.add(taskManagerMetricStore);
			}
		}
		return taskmanagerStores;
	}
}
 
Example 4
Source File: TaskManagerMetricsHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
protected MetricStore.ComponentMetricStore getComponentMetricStore(
		final HandlerRequest<EmptyRequestBody, TaskManagerMetricsMessageParameters> request,
		final MetricStore metricStore) {
	final ResourceID taskManagerId = request.getPathParameter(TaskManagerIdPathParameter.class);
	return metricStore.getTaskManagerMetricStore(taskManagerId.toString());
}
 
Example 5
Source File: TaskManagerMetricsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
protected MetricStore.ComponentMetricStore getComponentMetricStore(
		final HandlerRequest<EmptyRequestBody, TaskManagerMetricsMessageParameters> request,
		final MetricStore metricStore) {
	final ResourceID taskManagerId = request.getPathParameter(TaskManagerIdPathParameter.class);
	return metricStore.getTaskManagerMetricStore(taskManagerId.toString());
}
 
Example 6
Source File: TaskManagerMetricsHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
protected MetricStore.ComponentMetricStore getComponentMetricStore(
		final HandlerRequest<EmptyRequestBody, TaskManagerMetricsMessageParameters> request,
		final MetricStore metricStore) {
	final ResourceID taskManagerId = request.getPathParameter(TaskManagerIdPathParameter.class);
	return metricStore.getTaskManagerMetricStore(taskManagerId.toString());
}