Repository: stratos
Updated Branches:
  refs/heads/4.1.0-beta-deployment-policy-fix 15f7a108c -> 2ebca69e0


removing update partions kubernetes cluster ids logic from AS


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

Branch: refs/heads/4.1.0-beta-deployment-policy-fix
Commit: c04e42b0b561aa687fba894487bd326c1d5a7234
Parents: 15f7a10
Author: R-Rajkumar <[email protected]>
Authored: Thu Feb 19 13:56:31 2015 +0530
Committer: R-Rajkumar <[email protected]>
Committed: Thu Feb 19 13:56:31 2015 +0530

----------------------------------------------------------------------
 .../services/impl/AutoscalerServiceImpl.java    | 42 --------------------
 1 file changed, 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c04e42b0/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index 49f16b1..1595903 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -184,20 +184,9 @@ public class AutoscalerServiceImpl implements 
AutoscalerService {
                 throw new RuntimeException("Application context not found: " + 
applicationId);
             }
 
-            List<NetworkPartition> networkPartitionList = new 
ArrayList<NetworkPartition>();
-            ApplicationPolicyNetworkPartitionReference[] npReferences = 
applicationPolicy.getNetworkPartitionReferences();
-            for (ApplicationPolicyNetworkPartitionReference npReference : 
npReferences) {
-                               NetworkPartition networkPartition = 
AutoscalerObjectConverter.convertNetworkParitionStubToPojo(CloudControllerServiceClient
-                                               
.getInstance().getNetworkPartition(npReference.getNetworkPartitionId()));
-               networkPartitionList.add(networkPartition);             
-            }
-            
             // Create application clusters in cloud controller and send 
application created event
             ApplicationBuilder.handleApplicationCreatedEvent(application, 
applicationContext.getComponents().getApplicationClusterContexts());
 
-            // Update kubernetes cluster ids
-                       updateKubernetesClusterIds(applicationId, 
networkPartitionList);
-                       
                        // validating application policy
                        validateApplicationPolicy(applicationId, 
applicationPolicy);
                        
@@ -365,37 +354,6 @@ public class AutoscalerServiceImpl implements 
AutoscalerService {
         }
     }
 
-    /**
-     * Overwrite partition's kubernetes cluster ids with network partition's 
kubernetes cluster ids.
-     * 
-     * @param applicationId
-     * @param networkPartitions
-     */
-    private void updateKubernetesClusterIds(String applicationId, 
List<NetworkPartition> networkPartitions) {
-        
-        if(networkPartitions != null) {
-            for(NetworkPartition networkPartition : networkPartitions) {
-                
if(StringUtils.isNotBlank(networkPartition.getKubernetesClusterId())) {
-                    Partition[] partitions = networkPartition.getPartitions();
-                    if(partitions != null) {
-                        for(Partition partition : partitions) {
-                            if(partition != null) {
-                                if(log.isInfoEnabled()) {
-                                    log.info(String.format("Overwriting 
partition's kubernetes cluster id: " +
-                                                    "[application-id] %s 
[network-partition-id] %s [partition-id] %s " +
-                                                    "[kubernetes-cluster-id] 
%s",
-                                                    applicationId, 
networkPartition.getId(),
-                                            partition.getId(), 
networkPartition.getKubernetesClusterId()));
-                                }
-                                
partition.setKubernetesClusterId(networkPartition.getKubernetesClusterId());
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
     @Override
     public void undeployApplication(String applicationId) {
         try {

Reply via email to