You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/05/05 10:00:04 UTC
[39/50] [abbrv] git commit: updated refs/heads/planner_reserve to
9b86516
Adding `cloud`.`op_host_planner_reservation` schema, VO and DAO classes
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/593e43b9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/593e43b9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/593e43b9
Branch: refs/heads/planner_reserve
Commit: 593e43b93b2e88e0943a9873683890925ab7084d
Parents: 93277e8
Author: Prachi Damle <pr...@cloud.com>
Authored: Mon Apr 22 14:16:02 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Sat May 4 22:53:34 2013 -0700
----------------------------------------------------------------------
.../com/cloud/deploy/PlannerHostReservationVO.java | 135 +++++++++++++++
.../deploy/dao/PlannerHostReservationDao.java | 24 +++
.../deploy/dao/PlannerHostReservationDaoImpl.java | 27 +++
setup/db/db/schema-410to420.sql | 22 +++
4 files changed, 208 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/593e43b9/server/src/com/cloud/deploy/PlannerHostReservationVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/PlannerHostReservationVO.java b/server/src/com/cloud/deploy/PlannerHostReservationVO.java
new file mode 100644
index 0000000..47e1457
--- /dev/null
+++ b/server/src/com/cloud/deploy/PlannerHostReservationVO.java
@@ -0,0 +1,135 @@
+// 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 com.cloud.deploy;
+
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import org.apache.cloudstack.api.InternalIdentity;
+
+@Entity
+@Table(name = "op_host_planner_reservation")
+public class PlannerHostReservationVO implements InternalIdentity {
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private long id;
+
+ @Column(name="host_id")
+ private Long hostId;
+
+ @Column(name="data_center_id")
+ private Long dataCenterId;
+
+ @Column(name="pod_id")
+ private Long podId;
+
+ @Column(name="cluster_id")
+ private Long clusterId;
+
+ @Column(name = "resource_type")
+ private short resourceType;
+
+ @Column(name = "domain_id")
+ private long domainId;
+
+ @Column(name = "account_id")
+ private long accountId;
+
+ @Column(name = "deployment_planner")
+ private String deploymentPlanner;
+
+ public PlannerHostReservationVO() {
+ }
+
+ public PlannerHostReservationVO(Long hostId, Long dataCenterId, Long podId, Long clusterId, short resourceType,
+ String planner) {
+ this.hostId = hostId;
+ this.dataCenterId = dataCenterId;
+ this.podId = podId;
+ this.clusterId = clusterId;
+ this.resourceType = resourceType;
+ this.deploymentPlanner = planner;
+ }
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ public Long getHostId() {
+ return hostId;
+ }
+
+ public void setHostId(Long hostId) {
+ this.hostId = hostId;
+ }
+
+ public Long getDataCenterId() {
+ return dataCenterId;
+ }
+ public void setDataCenterId(Long dataCenterId) {
+ this.dataCenterId = dataCenterId;
+ }
+
+ public Long getPodId() {
+ return podId;
+ }
+ public void setPodId(long podId) {
+ this.podId = new Long(podId);
+ }
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+ public void setClusterId(long clusterId) {
+ this.clusterId = new Long(clusterId);
+ }
+
+ public short getResourceType() {
+ return resourceType;
+ }
+
+ public void setResourceType(short resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ public String getDeploymentPlanner() {
+ return deploymentPlanner;
+ }
+
+ public long getDomainId() {
+ return domainId;
+ }
+
+ public void setDomainId(long domainId) {
+ this.domainId = domainId;
+ }
+
+ public long getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(long accountId) {
+ this.accountId = accountId;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/593e43b9/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java b/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
new file mode 100644
index 0000000..112af95
--- /dev/null
+++ b/server/src/com/cloud/deploy/dao/PlannerHostReservationDao.java
@@ -0,0 +1,24 @@
+// 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 com.cloud.deploy.dao;
+
+import com.cloud.deploy.PlannerHostReservationVO;
+import com.cloud.utils.db.GenericDao;
+
+public interface PlannerHostReservationDao extends GenericDao<PlannerHostReservationVO, Long> {
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/593e43b9/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java b/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
new file mode 100644
index 0000000..ccda44b
--- /dev/null
+++ b/server/src/com/cloud/deploy/dao/PlannerHostReservationDaoImpl.java
@@ -0,0 +1,27 @@
+// 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 com.cloud.deploy.dao;
+
+import javax.ejb.Local;
+import com.cloud.deploy.PlannerHostReservationVO;
+import com.cloud.utils.db.GenericDaoBase;
+
+@Local(value = { PlannerHostReservationDao.class })
+public class PlannerHostReservationDaoImpl extends GenericDaoBase<PlannerHostReservationVO, Long> implements
+ PlannerHostReservationDao {
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/593e43b9/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 99b476d..3669384 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -918,6 +918,28 @@ CREATE TABLE `cloud`.`network_asa1000v_map` (
ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if public IP is associated with user VM creation by default when EIP service is enabled.' AFTER `elastic_ip_service`;
+
+CREATE TABLE `cloud`.`op_host_planner_reservation` (
+ `id` bigint unsigned NOT NULL auto_increment,
+ `data_center_id` bigint unsigned NOT NULL,
+ `pod_id` bigint unsigned,
+ `cluster_id` bigint unsigned,
+ `host_id` bigint unsigned,
+ `account_id` bigint unsigned,
+ `domain_id` bigint unsigned,
+ `deployment_planner` varchar(255) COMMENT 'Name of the Planner',
+ `resource_type` int(1) unsigned NOT NULL COMMENT 'shared(0) Vs dedicated(1)',
+ PRIMARY KEY (`id`),
+ INDEX `i_op_host_planner_reservation__host_type`(`host_id`, `resource_type`),
+ CONSTRAINT `fk_planner_reservation__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_planner_reservation__account_id` FOREIGN KEY `fk_resource_count__account_id`(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_planner_reservation__domain_id` FOREIGN KEY `fk_resource_count__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_planner_reservation__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `cloud`.`data_center`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_planner_reservation__pod_id` FOREIGN KEY (`pod_id`) REFERENCES `cloud`.`host_pod_ref`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_planner_reservation__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cloud`.`cluster`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+
-- Re-enable foreign key checking, at the end of the upgrade path
SET foreign_key_checks = 1;