Java源码示例:org.apache.flink.runtime.rest.messages.job.metrics.TaskManagersFilterQueryParameter
示例1
@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;
}
}
示例2
@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;
}
}
示例3
@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;
}
}