blob: fd931408725f4122f8b0c51b55fa4888b66e143a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core.hostinfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* HostInfo information only returned by content nodes (i.e. search nodes)
*/
public class ContentNode {
@JsonProperty("resource-usage")
private final Map<String, ResourceUsage> resourceUsage = new HashMap<>();
public Map<String, ResourceUsage> getResourceUsage() {
return Collections.unmodifiableMap(resourceUsage);
}
public Optional<ResourceUsage> resourceUsageOf(String type) {
return Optional.ofNullable(resourceUsage.get(type));
}
}
|