adding a map for Cluster Level Network Partition Context in VMClusterMonitor
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f5dc44cd Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f5dc44cd Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f5dc44cd Branch: refs/heads/master Commit: f5dc44cd604c01314ac4f95a4aad2c7670e5f7d0 Parents: c9bcd6e Author: Isuru Haththotuwa <[email protected]> Authored: Fri Nov 28 14:21:45 2014 +0530 Committer: Isuru Haththotuwa <[email protected]> Committed: Fri Nov 28 14:43:39 2014 +0530 ---------------------------------------------------------------------- .../autoscaler/monitor/cluster/VMClusterMonitor.java | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/f5dc44cd/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java index 2a59f02..3bc84f4 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java @@ -55,10 +55,19 @@ import org.apache.stratos.messaging.message.receiver.topology.TopologyManager; abstract public class VMClusterMonitor extends AbstractClusterMonitor { private static final Log log = LogFactory.getLog(VMClusterMonitor.class); + private Map<String, ClusterLevelNetworkPartitionContext> networkPartitionIdToClusterLevelNetworkPartitionCtxts; protected VMClusterMonitor(String serviceType, String clusterId, AutoscalerRuleEvaluator autoscalerRuleEvaluator) { super(serviceType, clusterId, autoscalerRuleEvaluator); + this.networkPartitionIdToClusterLevelNetworkPartitionCtxts = new HashMap<String, ClusterLevelNetworkPartitionContext>(); + } + + public void addClusterLevelNWPartitionContext (ClusterLevelNetworkPartitionContext clusterLevelNWPartitionCtxt) { + networkPartitionIdToClusterLevelNetworkPartitionCtxts.put(clusterLevelNWPartitionCtxt.getId(), clusterLevelNWPartitionCtxt); + } + public ClusterLevelNetworkPartitionContext getClusterLevelNWPartitionContext (String nwPartitionId) { + return networkPartitionIdToClusterLevelNetworkPartitionCtxts.get(nwPartitionId); } @Override
