Resolving conflicts again!

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b098d8a3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b098d8a3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b098d8a3

Branch: refs/heads/master
Commit: b098d8a32d03a41ab8b1be3d5e9e78027adf4557
Parents: e31685c
Author: Nirmal Fernando <[email protected]>
Authored: Sun Dec 7 18:04:41 2014 +0530
Committer: Nirmal Fernando <[email protected]>
Committed: Sun Dec 7 18:04:41 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/monitor/MonitorFactory.java      | 45 ++++++++------------
 1 file changed, 18 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b098d8a3/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
index a981eec..278b247 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
@@ -281,35 +281,26 @@ public class MonitorFactory {
                 if (parentMonitorInstance != null) {
                     ClusterInstance clusterInstance = 
cluster.getInstanceContexts(parentInstanceId);
                     if (clusterInstance != null) {
-                        if (cluster.isKubernetesCluster()) {
-                            clusterMonitor.setClusterContext(
-                                    
ClusterContextFactory.getKubernetesClusterContext(
-                                            clusterInstance.getInstanceId(),
-                                            cluster));
-                        } else {
-                            //Cluster instance is already there. No need to 
create one.
-                            VMClusterContext clusterContext;
-                            clusterContext = ClusterContextFactory.
-                                    
getVMClusterContext(clusterInstance.getInstanceId(),
-                                            cluster);
-                            clusterMonitor.setClusterContext(clusterContext);
-                            //create VMClusterContext and then add all the 
instanceContexts
-                            
clusterContext.addInstanceContext(parentInstanceId, cluster);
-                            if 
(clusterMonitor.getInstance(clusterInstance.getInstanceId()) == null) {
-                                clusterMonitor.addInstance(clusterInstance);
-                            }
-                            //Checking the current status of the cluster 
instance
-                            boolean stateChanged = 
ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
-                                    process("", clusterId, 
clusterInstance.getInstanceId());
-                            if(!stateChanged && clusterInstance.getStatus() != 
ClusterStatus.Created) {
-                                
clusterMonitor.notifyParentMonitor(clusterInstance.getStatus(),
-                                        clusterInstance.getInstanceId());
-                            }
+                        // Cluster instance is already there. No need to 
create one.
+                        VMClusterContext clusterContext;
+                        clusterContext =
+                                
ClusterContextFactory.getVMClusterContext(clusterInstance.getInstanceId(), 
cluster);
+                        clusterMonitor.setClusterContext(clusterContext);
+                        // create VMClusterContext and then add all the 
instanceContexts
+                        clusterContext.addInstanceContext(parentInstanceId, 
cluster);
+                        if 
(clusterMonitor.getInstance(clusterInstance.getInstanceId()) == null) {
+                            clusterMonitor.addInstance(clusterInstance);
+                        }
+                        // Checking the current status of the cluster instance
+                        boolean stateChanged =
+                                
ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain()
+                                        .process("", clusterId, 
clusterInstance.getInstanceId());
+                        if (!stateChanged && clusterInstance.getStatus() != 
ClusterStatus.Created) {
+                            
clusterMonitor.notifyParentMonitor(clusterInstance.getStatus(),
+                                    clusterInstance.getInstanceId());
                         }
                     } else {
-                        createClusterInstance(cluster.getServiceName(),
-                                clusterId, null,
-                                parentInstanceId, partitionId,
+                        createClusterInstance(cluster.getServiceName(), 
clusterId, null, parentInstanceId, partitionId,
                                 parentMonitorInstance.getNetworkPartitionId());
                     }
 

Reply via email to