aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/ContentNode.java
blob: 45f67c09ac4bd5983412dbdd0907e4e2da0607b7 (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 Yahoo. 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));
    }
}