diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-10-30 18:39:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 18:39:12 +0100 |
commit | 8042b5796cddb6be5d1066ee500e2fd8cdc36b4a (patch) | |
tree | 99f620bfa183e852dd2171b51f88891da333c329 /config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java | |
parent | 02ba50ec81753db5e2c1e28f3ea718ca489c657b (diff) |
Revert "Add devhost node type"
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java index 74a14e51122..44bd7ec3708 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeType.java @@ -1,9 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.provision; -import java.util.List; -import java.util.Set; - /** * The possible types of nodes in the node repository * @@ -12,42 +9,39 @@ import java.util.Set; public enum NodeType { /** A node to be assigned to a tenant to run application workloads */ - tenant("Tenant node"), + tenant(null, "Tenant node"), /** A host of a set of (Docker) tenant nodes */ - host("Tenant docker host", tenant), + host(tenant, "Tenant docker host"), /** Nodes running the shared proxy layer */ - proxy("Proxy node"), + proxy(null, "Proxy node"), /** A host of a (Docker) proxy node */ - proxyhost("Proxy docker host", proxy), + proxyhost(proxy, "Proxy docker host"), /** A config server */ - config("Config server"), + config(null, "Config server"), /** A host of a (Docker) config server node */ - confighost("Config docker host", config), + confighost(config, "Config docker host"), /** A controller */ - controller("Controller"), + controller(null, "Controller"), /** A host of a (Docker) controller node */ - controllerhost("Controller host", controller), - - /** A host of multiple nodes, only used in {@link SystemName#dev} */ - devhost("Dev host", tenant, config, controller); + controllerhost(controller, "Controller host"); - private final List<NodeType> childNodeTypes; + private final NodeType childNodeType; private final String description; - NodeType(String description, NodeType... childNodeTypes) { - this.childNodeTypes = List.copyOf(Set.of(childNodeTypes)); + NodeType(NodeType childNodeType, String description) { + this.childNodeType = childNodeType; this.description = description; } public boolean isDockerHost() { - return !childNodeTypes.isEmpty(); + return childNodeType != null; } public String description() { @@ -59,17 +53,9 @@ public enum NodeType { * @throws IllegalStateException if this type is not a host */ public NodeType childNodeType() { - return childNodeTypes().get(0); - } - - /** - * @return all {@link NodeType}s that can run on this host - * @throws IllegalStateException if this type is not a host - */ - public List<NodeType> childNodeTypes() { if (! isDockerHost()) throw new IllegalStateException(this + " has no children"); - return childNodeTypes; - } + return childNodeType; + } } |