public interface ClusterLayoutChange
ClusterLayout
, such as adding a service to some of the nodes. Caller is
responsible for calling the canApplyChange(co.cask.coopr.layout.ClusterLayout)
method to validate
if a change can be applied to a layout before actually applying the change with
applyChange(co.cask.coopr.layout.ClusterLayout)
or
applyChange(co.cask.coopr.cluster.Cluster, java.util.Set, java.util.Map)
.Modifier and Type | Method and Description |
---|---|
ClusterLayout |
applyChange(ClusterLayout layout)
Apply the change to the given
ClusterLayout . |
Set<Node> |
applyChange(Cluster cluster,
Set<Node> clusterNodes,
Map<String,Service> serviceMap)
Apply the change to a set of nodes, returning nodes that have changed.
|
boolean |
canApplyChange(ClusterLayout layout)
Returns whether or not the change can be applied to the given
ClusterLayout . |
boolean canApplyChange(ClusterLayout layout)
ClusterLayout
. This is not for checking
if the resulting cluster layout would satisfy all its constraints, but for checking whether or not it is physically
possible to apply the change. For example, it is not physically possible to add a service to 10 nodes if the
cluster is only 5 nodes.layout
- Layout to check the legality of the change for.ClusterLayout applyChange(ClusterLayout layout)
ClusterLayout
. Returns a new layout object and does not modify the given
layout.layout
- Layout to apply the change to.Set<Node> applyChange(Cluster cluster, Set<Node> clusterNodes, Map<String,Service> serviceMap)
cluster
- Cluster to apply the change to.clusterNodes
- Nodes to apply the change to.serviceMap
- Map of service name to Service
for available services.
TODO: remove the need for the serviceMapCopyright © 2013-2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.