Skip to content

Commit d9d128e

Browse files
author
Kelven Yang
committed
Incremental refactoring - retire host_master table
1 parent 9c2db92 commit d9d128e

4 files changed

Lines changed: 6 additions & 25 deletions

File tree

‎api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
2929
String poolUuid;
3030
long poolId;
3131

32-
//
33-
// Temporary hacking to make vmware work quickly, expose NFS raw information to allow
34-
// agent do quick copy over NFS.
35-
//
36-
// provide storage URL (it contains all information to help agent resource to mount the
37-
// storage if needed, example of such URL may be as following
38-
// nfs://192.168.10.231/export/home/kelven/vmware-test/secondary
3932
String secondaryStorageUrl;
4033
String primaryStorageUrl;
4134

‎core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
import com.cloud.agent.api.ReadyAnswer;
4242
import com.cloud.agent.api.ReadyCommand;
4343
import com.cloud.agent.api.SecStorageFirewallCfgCommand;
44+
import com.cloud.agent.api.SecStorageFirewallCfgCommand.PortConfig;
4445
import com.cloud.agent.api.SecStorageSetupCommand;
4546
import com.cloud.agent.api.StartupCommand;
4647
import com.cloud.agent.api.StartupStorageCommand;
47-
import com.cloud.agent.api.SecStorageFirewallCfgCommand.PortConfig;
4848
import com.cloud.agent.api.storage.CreateEntityDownloadURLCommand;
4949
import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand;
5050
import com.cloud.agent.api.storage.DeleteTemplateCommand;
@@ -56,8 +56,8 @@
5656
import com.cloud.resource.ServerResource;
5757
import com.cloud.resource.ServerResourceBase;
5858
import com.cloud.storage.Storage;
59-
import com.cloud.storage.StorageLayer;
6059
import com.cloud.storage.Storage.StoragePoolType;
60+
import com.cloud.storage.StorageLayer;
6161
import com.cloud.storage.template.DownloadManager;
6262
import com.cloud.storage.template.DownloadManagerImpl;
6363
import com.cloud.storage.template.TemplateInfo;
@@ -118,13 +118,13 @@ public Answer executeRequest(Command cmd) {
118118
return _dlMgr.handleDownloadCommand((DownloadProgressCommand)cmd);
119119
} else if (cmd instanceof DownloadCommand) {
120120
return _dlMgr.handleDownloadCommand((DownloadCommand)cmd);
121-
}else if (cmd instanceof UploadCommand) {
121+
} else if (cmd instanceof UploadCommand) {
122122
return _upldMgr.handleUploadCommand((UploadCommand)cmd);
123-
}else if (cmd instanceof CreateEntityDownloadURLCommand){
123+
} else if (cmd instanceof CreateEntityDownloadURLCommand){
124124
return _upldMgr.handleCreateEntityURLCommand((CreateEntityDownloadURLCommand)cmd);
125-
}else if(cmd instanceof DeleteEntityDownloadURLCommand){
125+
} else if(cmd instanceof DeleteEntityDownloadURLCommand){
126126
return _upldMgr.handleDeleteEntityDownloadURLCommand((DeleteEntityDownloadURLCommand)cmd);
127-
}else if (cmd instanceof GetStorageStatsCommand) {
127+
} else if (cmd instanceof GetStorageStatsCommand) {
128128
return execute((GetStorageStatsCommand)cmd);
129129
} else if (cmd instanceof CheckHealthCommand) {
130130
return new CheckHealthAnswer((CheckHealthCommand)cmd, true);

‎setup/db/create-index-fk.sql‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm
137137
ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__instance_id`(`instance_id`);
138138
ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__mgmt_server_id`(`mgmt_server_id`);
139139

140-
ALTER TABLE `cloud`.`host_master` ADD UNIQUE `i_host_master__service_address`(`service_address`);
141-
142140
ALTER TABLE `cloud`.`instance_group` ADD CONSTRAINT `fk_instance_group__account_id` FOREIGN KEY `fk_instance_group__account_id` (`account_id`) REFERENCES `account` (`id`);
143141

144142
ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___group_id` FOREIGN KEY `fk_instance_group_vm_map___group_id` (`group_id`) REFERENCES `instance_group` (`id`) ON DELETE CASCADE;

‎setup/db/create-schema.sql‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ DROP TABLE IF EXISTS `cloud`.`nics`;
7777
DROP TABLE IF EXISTS `cloud`.`networks`;
7878
DROP TABLE IF EXISTS `cloud`.`op_networks`;
7979
DROP TABLE IF EXISTS `cloud`.`network_offerings`;
80-
DROP TABLE IF EXISTS `cloud`.`host_master`;
8180
DROP TABLE IF EXISTS `cloud`.`hypervisor_properties`;
8281
DROP TABLE IF EXISTS `cloud`.`account_network_ref`;
8382
DROP TABLE IF EXISTS `cloud`.`instance_group`;
@@ -1271,15 +1270,6 @@ CREATE TABLE `cloud`.`op_vm_ruleset_log` (
12711270
PRIMARY KEY (`id`)
12721271
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
12731272

1274-
CREATE TABLE `cloud`.`host_master` (
1275-
`id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id',
1276-
`type` varchar(32) NOT NULL,
1277-
`service_address` varchar(255) NOT NULL,
1278-
`admin` varchar(32) NOT NULL,
1279-
`password` varchar(32),
1280-
PRIMARY KEY (`id`)
1281-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1282-
12831273
CREATE TABLE `cloud`.`instance_group` (
12841274
`id` bigint unsigned NOT NULL UNIQUE auto_increment,
12851275
`account_id` bigint unsigned NOT NULL COMMENT 'owner. foreign key to account table',

0 commit comments

Comments
 (0)