From 0624fe5d030f14b1f143db75e45022a4fbf821d0 Mon Sep 17 00:00:00 2001 From: tuna Date: Mon, 4 Nov 2013 11:05:57 +0700 Subject: [PATCH] remove unused table: ovs_nic_map --- client/tomcatconf/applicationContext.xml.in | 1 - .../network/ovs/dao/OvsNicMappingDao.java | 24 ------ .../network/ovs/dao/OvsNicMappingDaoImpl.java | 47 ----------- .../network/ovs/dao/OvsNicMappingVO.java | 83 ------------------- setup/db/db/schema-410to420.sql | 10 --- 5 files changed, 165 deletions(-) delete mode 100644 plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDao.java delete mode 100644 plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDaoImpl.java delete mode 100644 plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingVO.java diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index b3778d48b8d..b61022753c6 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -266,7 +266,6 @@ - diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDao.java deleted file mode 100644 index b2128eb7a90..00000000000 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDao.java +++ /dev/null @@ -1,24 +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 com.cloud.network.ovs.dao; - -import com.cloud.utils.db.GenericDao; - -public interface OvsNicMappingDao extends GenericDao { - - public OvsNicMappingVO findByNicUuid(String nicUuid); -} diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDaoImpl.java deleted file mode 100644 index 87e41b713c9..00000000000 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingDaoImpl.java +++ /dev/null @@ -1,47 +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 com.cloud.network.ovs.dao; - -import javax.ejb.Local; - -import org.springframework.stereotype.Component; - -import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.SearchCriteria.Op; - -@Component -@Local(value=OvsNicMappingDao.class) -public class OvsNicMappingDaoImpl extends GenericDaoBase implements OvsNicMappingDao{ - - protected final SearchBuilder nicSearch; - - public OvsNicMappingDaoImpl() { - nicSearch = createSearchBuilder(); - nicSearch.and("nicUuid", nicSearch.entity().getNicUuid(), Op.EQ); - nicSearch.done(); - } - - @Override - public OvsNicMappingVO findByNicUuid(String nicUuid) { - SearchCriteria sc = nicSearch.create(); - sc.setParameters("nicUuid", nicUuid); - return findOneBy(sc); - } - -} diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingVO.java deleted file mode 100644 index dc4a9315482..00000000000 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsNicMappingVO.java +++ /dev/null @@ -1,83 +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 com.cloud.network.ovs.dao; - -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="ovs_nic_map") -public class OvsNicMappingVO implements InternalIdentity { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id") - private long id; - - @Column(name="logicalswitch") - private String logicalSwitchUuid; - - @Column(name="logicalswitchport") - private String logicalSwitchPortUuid; - - @Column(name="nic") - private String nicUuid; - - public OvsNicMappingVO() { - - } - - public OvsNicMappingVO (String logicalSwitchUuid, String logicalSwitchPortUuid, String nicUuid) { - this.logicalSwitchUuid = logicalSwitchUuid; - this.logicalSwitchPortUuid = logicalSwitchPortUuid; - this.nicUuid = nicUuid; - } - - public String getLogicalSwitchUuid() { - return logicalSwitchUuid; - } - - public void setLogicalSwitchUuid(String logicalSwitchUuid) { - this.logicalSwitchUuid = logicalSwitchUuid; - } - - public String getLogicalSwitchPortUuid() { - return logicalSwitchPortUuid; - } - - public void setLogicalSwitchPortUuid(String logicalSwitchPortUuid) { - this.logicalSwitchPortUuid = logicalSwitchPortUuid; - } - - public String getNicUuid() { - return nicUuid; - } - - public void setNicUuid(String nicUuid) { - this.nicUuid = nicUuid; - } - - public long getId() { - return id; - } -} diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 6ec5723e825..00ac4d1ce51 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -2103,16 +2103,6 @@ CREATE TABLE `cloud`.`vm_disk_statistics` ( insert into `cloud`.`vm_disk_statistics`(data_center_id,account_id,vm_id,volume_id) select volumes.data_center_id, volumes.account_id, vm_instance.id, volumes.id from volumes,vm_instance where vm_instance.vm_type="User" and vm_instance.state<>"Expunging" and volumes.instance_id=vm_instance.id order by vm_instance.id; -DROP TABLE IF EXISTS `cloud`.`ovs_nic_map`; -CREATE TABLE `cloud`.`ovs_nic_map` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `logicalswitch` varchar(255) NOT NULL COMMENT 'uuid of logical switch this port is provisioned on', - `logicalswitchport` varchar(255) UNIQUE COMMENT 'uuid of this logical switch port', - `nic` varchar(255) UNIQUE COMMENT 'cloudstack uuid of the nic connected to this logical switch port', - PRIMARY KEY (`id`), - CONSTRAINT `fk_ovs_nic_map__nic` FOREIGN KEY(`nic`) REFERENCES `nics`(`uuid`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - DROP TABLE IF EXISTS `cloud`.`ovs_providers`; CREATE TABLE `cloud`.`ovs_providers` ( `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',