Package com.yahoo.config.model.provision
Class InMemoryProvisioner
java.lang.Object
com.yahoo.config.model.provision.InMemoryProvisioner
- All Implemented Interfaces:
com.yahoo.config.model.api.HostProvisioner
public class InMemoryProvisioner
extends Object
implements com.yahoo.config.model.api.HostProvisioner
In memory host provisioner for testing only.
NB! ATM cannot be reused after allocate has been called.
- Author:
- hmusum, bratseth
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.yahoo.config.provision.NodeResources
-
Constructor Summary
ConstructorDescriptionInMemoryProvisioner
(boolean failOnOutOfCapacity, boolean sharedHosts, String... hosts) Creates this with a set of host names of the flavor 'default'InMemoryProvisioner
(boolean failOnOutOfCapacity, boolean sharedHosts, List<String> hosts) Creates this with a set of host names of the flavor 'default'InMemoryProvisioner
(int nodeCount, boolean sharedHosts) Creates this with a number of nodes with resources 1, 3, 9, 1InMemoryProvisioner
(int nodeCount, com.yahoo.config.provision.NodeResources resources, boolean sharedHosts) Creates this with a number of nodes with given resourcesInMemoryProvisioner
(int nodeCount, com.yahoo.config.provision.NodeResources resources, boolean sharedHosts, com.yahoo.config.provision.NodeResources defaultResources) Creates this with a number of nodes with given resourcesInMemoryProvisioner
(Hosts hosts, boolean failOnOutOfCapacity, boolean sharedHosts, int startIndexForClusters, String... retiredHostNames) Creates this with a set of hosts of the flavor 'default'InMemoryProvisioner
(Hosts hosts, boolean failOnOutOfCapacity, boolean sharedHosts, String... retiredHostNames) Creates this with a set of hosts of the flavor 'default'InMemoryProvisioner
(Map<com.yahoo.config.provision.NodeResources, Collection<Host>> hosts, boolean failOnOutOfCapacity, boolean useMaxResources, boolean alwaysReturnOneNode, boolean sharedHosts, com.yahoo.config.provision.NodeResources defaultResources, int startIndexForClusters, String... retiredHostNames) -
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.config.provision.HostSpec
allocateHost
(String alias) Returns the current allocations of this as a mutable mapList<com.yahoo.config.provision.HostSpec>
prepare
(com.yahoo.config.provision.ClusterSpec cluster, com.yahoo.config.provision.Capacity requested, com.yahoo.config.provision.ProvisionLogger logger) List<com.yahoo.config.provision.HostSpec>
prepare
(com.yahoo.config.provision.ClusterSpec cluster, com.yahoo.config.provision.ClusterResources requested, int groups, boolean required, boolean canFail) com.yahoo.config.model.api.Provisioned
Set<com.yahoo.config.provision.ClusterSpec>
setEnvironment
(com.yahoo.config.provision.Environment environment) May affect e.g.com.yahoo.config.model.api.Provisioned
Create a new provisioned instance to record provision requests to this and returns it
-
Field Details
-
defaultHostResources
public static final com.yahoo.config.provision.NodeResources defaultHostResources
-
-
Constructor Details
-
InMemoryProvisioner
public InMemoryProvisioner(int nodeCount, boolean sharedHosts) Creates this with a number of nodes with resources 1, 3, 9, 1 -
InMemoryProvisioner
public InMemoryProvisioner(int nodeCount, com.yahoo.config.provision.NodeResources resources, boolean sharedHosts) Creates this with a number of nodes with given resources -
InMemoryProvisioner
public InMemoryProvisioner(int nodeCount, com.yahoo.config.provision.NodeResources resources, boolean sharedHosts, com.yahoo.config.provision.NodeResources defaultResources) Creates this with a number of nodes with given resources -
InMemoryProvisioner
Creates this with a set of host names of the flavor 'default' -
InMemoryProvisioner
Creates this with a set of host names of the flavor 'default' -
InMemoryProvisioner
public InMemoryProvisioner(Hosts hosts, boolean failOnOutOfCapacity, boolean sharedHosts, String... retiredHostNames) Creates this with a set of hosts of the flavor 'default' -
InMemoryProvisioner
public InMemoryProvisioner(Hosts hosts, boolean failOnOutOfCapacity, boolean sharedHosts, int startIndexForClusters, String... retiredHostNames) Creates this with a set of hosts of the flavor 'default' -
InMemoryProvisioner
public InMemoryProvisioner(Map<com.yahoo.config.provision.NodeResources, Collection<Host>> hosts, boolean failOnOutOfCapacity, boolean useMaxResources, boolean alwaysReturnOneNode, boolean sharedHosts, com.yahoo.config.provision.NodeResources defaultResources, int startIndexForClusters, String... retiredHostNames)
-
-
Method Details
-
provisioned
public com.yahoo.config.model.api.Provisioned provisioned() -
setEnvironment
May affect e.g. the number of nodes/cluster. -
allocations
public Map<com.yahoo.config.provision.ClusterSpec,List<com.yahoo.config.provision.HostSpec>> allocations()Returns the current allocations of this as a mutable map -
allocateHost
- Specified by:
allocateHost
in interfacecom.yahoo.config.model.api.HostProvisioner
-
prepare
public List<com.yahoo.config.provision.HostSpec> prepare(com.yahoo.config.provision.ClusterSpec cluster, com.yahoo.config.provision.Capacity requested, com.yahoo.config.provision.ProvisionLogger logger) - Specified by:
prepare
in interfacecom.yahoo.config.model.api.HostProvisioner
-
prepare
public List<com.yahoo.config.provision.HostSpec> prepare(com.yahoo.config.provision.ClusterSpec cluster, com.yahoo.config.provision.ClusterResources requested, int groups, boolean required, boolean canFail) -
startProvisionedRecording
public com.yahoo.config.model.api.Provisioned startProvisionedRecording()Create a new provisioned instance to record provision requests to this and returns it -
provisionedClusters
-