You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/04/18 04:25:57 UTC

[09/41] git commit: updated refs/heads/marvin_refactor to 94b18c6

Pulling back the changes to ServiceOffering to add a planner - these changes will be part of a separate feature branch


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

Branch: refs/heads/marvin_refactor
Commit: 77ccc2272380567fff50ab831f3bd02428d5d8f4
Parents: a4d8c48
Author: Prachi Damle <pr...@cloud.com>
Authored: Tue Apr 16 14:28:55 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Tue Apr 16 15:17:01 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/server/ManagementService.java    |    2 -
 .../org/apache/cloudstack/api/ApiConstants.java    |    1 -
 .../admin/config/ListDeploymentPlannersCmd.java    |   71 ---------------
 .../admin/offering/CreateServiceOfferingCmd.java   |    6 --
 .../cloud/configuration/ConfigurationManager.java  |    3 +-
 .../configuration/ConfigurationManagerImpl.java    |    6 +-
 .../src/com/cloud/server/ManagementServerImpl.java |   19 ----
 .../src/com/cloud/service/ServiceOfferingVO.java   |   23 -----
 .../cloud/vpc/MockConfigurationManagerImpl.java    |    2 +-
 setup/db/db/schema-410to420.sql                    |    1 -
 10 files changed, 5 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 6e6dbc3..460357b 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -407,6 +407,4 @@ public interface ManagementService {
      */
     List<? extends Capacity> listTopConsumedResources(ListCapacityCmd cmd);
 
-    List<String> listDeploymentPlanners();
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 37cb59f..cb4d43e 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -475,7 +475,6 @@ public class ApiConstants {
     public static final String HEALTHCHECK_PINGPATH = "pingpath";
     public static final String AFFINITY_GROUP_IDS = "affinitygroupids";
     public static final String AFFINITY_GROUP_NAMES = "affinitygroupnames";
-    public static final String DEPLOYMENT_PLANNER = "deploymentplanner";
     public static final String ASA_INSIDE_PORT_PROFILE = "insideportprofile";
 
     public enum HostDetails {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
deleted file mode 100644
index 69004de..0000000
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.command.admin.config;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.response.DeploymentPlannersResponse;
-import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
-
-@APICommand(name = "listDeploymentPlanners", description = "Lists all DeploymentPlanners available.", responseObject = DeploymentPlannersResponse.class)
-public class ListDeploymentPlannersCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDeploymentPlannersCmd.class.getName());
-
-    private static final String s_name = "listdeploymentplannersresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public void execute(){
-        List<String> planners = _mgr.listDeploymentPlanners();
-        ListResponse<DeploymentPlannersResponse> response = new ListResponse<DeploymentPlannersResponse>();
-        List<DeploymentPlannersResponse> plannerResponses = new ArrayList<DeploymentPlannersResponse>();
-
-        for (String planner : planners) {
-            DeploymentPlannersResponse plannerResponse = new DeploymentPlannersResponse();
-            plannerResponse.setName(planner);
-            plannerResponse.setObjectName("deploymentPlanner");
-            plannerResponses.add(plannerResponse);
-        }
-
-        response.setResponses(plannerResponses);
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
index 74392cd..0e35276 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
@@ -84,9 +84,6 @@ public class CreateServiceOfferingCmd extends BaseCmd {
     @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype")
     private Integer networkRate;
 
-    @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, type = CommandType.STRING, description = "The deployment planner heuristics used to deploy a VM of this offering, default \"FirstFitPlanner\".")
-    private String deploymentPlanner;
-
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -151,9 +148,6 @@ public class CreateServiceOfferingCmd extends BaseCmd {
         return networkRate;
     }
 
-    public String getDeploymentPlanner() {
-        return deploymentPlanner;
-    }
 
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/server/src/com/cloud/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManager.java b/server/src/com/cloud/configuration/ConfigurationManager.java
index d7faf19..afaf0d6 100755
--- a/server/src/com/cloud/configuration/ConfigurationManager.java
+++ b/server/src/com/cloud/configuration/ConfigurationManager.java
@@ -79,11 +79,10 @@ public interface ConfigurationManager extends ConfigurationService, Manager {
      *            TODO
      * @param id
      * @param useVirtualNetwork
-     * @param deploymentPlanner
      * @return ID
      */
     ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired,
-            boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner);
+            boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate);
 
     /**
      * Creates a new disk offering

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index cb780ea..3551295 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -1823,16 +1823,16 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
         }
 
         return createServiceOffering(userId, cmd.getIsSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber.intValue(), memory.intValue(), cpuSpeed.intValue(), cmd.getDisplayText(),
-                localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate(), cmd.getDeploymentPlanner());
+                localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate());
     }
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_SERVICE_OFFERING_CREATE, eventDescription = "creating service offering")
     public ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_type, String name, int cpu, int ramSize, int speed, String displayText,
-            boolean localStorageRequired, boolean offerHA, boolean limitResourceUse, boolean volatileVm,  String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner) {
+            boolean localStorageRequired, boolean offerHA, boolean limitResourceUse, boolean volatileVm,  String tags, Long domainId, String hostTag, Integer networkRate) {
         tags = cleanupTags(tags);
         ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, speed, networkRate, null, offerHA, limitResourceUse, volatileVm, displayText, localStorageRequired, false, tags, isSystem, vm_type,
-                domainId, hostTag, deploymentPlanner);
+                domainId, hostTag);
 
         if ((offering = _serviceOfferingDao.persist(offering)) != null) {
             UserContext.current().setEventDetails("Service offering id=" + offering.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 5ed0c92..98f789a 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -392,14 +392,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     private List<UserAuthenticator> _userAuthenticators;
     private List<UserAuthenticator> _userPasswordEncoders;
 
-    protected List<DeploymentPlanner> _planners;
-    public List<DeploymentPlanner> getPlanners() {
-        return _planners;
-    }
-    public void setPlanners(List<DeploymentPlanner> _planners) {
-        this._planners = _planners;
-    }
-
     @Inject ClusterManager _clusterMgr;
     private String _hashKey = null;
     private String _encryptionKey = null;
@@ -3386,15 +3378,4 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         }
 
     }
-
-    @Override
-    public List<String> listDeploymentPlanners() {
-        List<String> plannersAvailable = new ArrayList<String>();
-        for (DeploymentPlanner planner : _planners) {
-            plannersAvailable.add(planner.getName());
-        }
-
-        return plannersAvailable;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/server/src/com/cloud/service/ServiceOfferingVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java b/server/src/com/cloud/service/ServiceOfferingVO.java
index a3da904..94a7351 100755
--- a/server/src/com/cloud/service/ServiceOfferingVO.java
+++ b/server/src/com/cloud/service/ServiceOfferingVO.java
@@ -68,9 +68,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
     @Column(name="sort_key")
     int sortKey;
 
-    @Column(name = "deployment_planner")
-    private String deploymentPlanner = "FirstFitPlanner";
-
     protected ServiceOfferingVO() {
         super();
     }
@@ -87,7 +84,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
         this.volatileVm = false;
         this.default_use = defaultUse;
         this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase();
-        this.deploymentPlanner = "FirstFitPlanner";
     }
 
     public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) {
@@ -101,26 +97,11 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
         this.limitCpuUse = limitCpuUse;
         this.volatileVm = volatileVm;
         this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase();
-        this.deploymentPlanner = "FirstFitPlanner";
     }
 
     public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) {
         this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId);
         this.hostTag = hostTag;
-        this.deploymentPlanner = "FirstFitPlanner";
-    }
-
-    public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps,
-            boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage,
-            boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId,
-            String hostTag, String deploymentPlanner) {
-        this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm,
-                displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId, hostTag);
-        if (deploymentPlanner != null) {
-            this.deploymentPlanner = deploymentPlanner;
-        } else {
-            this.deploymentPlanner = "FirstFitPlanner";
-        }
     }
 
     @Override
@@ -227,8 +208,4 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
         return volatileVm;
     }
 
-    public String getDeploymentPlanner() {
-        return deploymentPlanner;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index a03e361..9443815 100755
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -435,7 +435,7 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu
      */
     @Override
     public ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired, boolean offerHA,
-            boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner) {
+            boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77ccc227/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 79a2279..6a7a72c 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -167,7 +167,6 @@ CREATE TABLE `cloud`.`affinity_group_vm_map` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
-ALTER TABLE `cloud`.`service_offering` ADD COLUMN `deployment_planner` varchar(255) NOT NULL DEFAULT 'FirstFitPlanner'  COMMENT 'Planner heuristics used to deploy a VM of this offering';
 
 CREATE TABLE nic_secondary_ips (
   `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT,