cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/4.2 to 79209c1
Date Tue, 23 Jul 2013 13:15:30 GMT
Updated Branches:
  refs/heads/4.2 6b2c9bf3a -> 79209c133


CLOUDSTACK-3526. When volume upload is in progress the state of the volume is UploadError.
Update volume_view to join volumes table with volume_store_ref table instead of volume_host_ref
table.


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

Branch: refs/heads/4.2
Commit: 79209c133074f05b73c6ed1ac939150c4fecb546
Parents: 6b2c9bf
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Tue Jul 23 17:17:32 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Tue Jul 23 18:41:20 2013 +0530

----------------------------------------------------------------------
 .../cloud/api/query/dao/VolumeJoinDaoImpl.java  |   4 +-
 .../com/cloud/api/query/vo/VolumeJoinVO.java    |  34 ++---
 setup/db/db/schema-410to420.sql                 | 123 ++-----------------
 3 files changed, 21 insertions(+), 140 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79209c13/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
index 1c18c96..371dc51 100644
--- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
@@ -110,8 +110,8 @@ public class VolumeJoinDaoImpl extends GenericDaoBase<VolumeJoinVO,
Long> implem
             // com.cloud.storage.VolumeHostVO volumeHostRef =
             // ApiDBUtils.findVolumeHostRef(volume.getId(),
             // volume.getDataCenterId());
-            volResponse.setSize(volume.getVolumeHostSize());
-            volResponse.setCreated(volume.getVolumeHostCreated());
+            volResponse.setSize(volume.getVolumeStoreSize());
+            volResponse.setCreated(volume.getCreatedOnStore());
 
             if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN)
                 volResponse.setHypervisor(ApiDBUtils.getHypervisorTypeFromFormat(volume.getFormat()).toString());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79209c13/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
index 701e195..c7b43ba 100644
--- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
@@ -144,11 +144,11 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity
{
     @Enumerated(value=EnumType.STRING)
     protected VirtualMachine.Type vmType;
 
-    @Column (name="volume_host_size")
-    private long volumeHostSize;
+    @Column(name = "volume_store_size")
+    private long volumeStoreSize;
 
-    @Column(name="volume_host_created")
-    private Date volumeHostCreated;
+    @Column(name = "created_on_store")
+    private Date createdOnStore;
 
     @Column(name="format")
     private Storage.ImageFormat format;
@@ -625,32 +625,22 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity
{
         this.vmType = vmType;
     }
 
-
-
-    public long getVolumeHostSize() {
-        return volumeHostSize;
+    public long getVolumeStoreSize() {
+        return volumeStoreSize;
     }
 
-
-
-    public void setVolumeHostSize(long volumeHostSize) {
-        this.volumeHostSize = volumeHostSize;
+    public void setVolumeStoreSize(long volumeStoreSize) {
+        this.volumeStoreSize = volumeStoreSize;
     }
 
-
-
-    public Date getVolumeHostCreated() {
-        return volumeHostCreated;
+    public Date getCreatedOnStore() {
+        return createdOnStore;
     }
 
-
-
-    public void setVolumeHostCreated(Date volumeHostCreated) {
-        this.volumeHostCreated = volumeHostCreated;
+    public void setCreatedOnStore(Date createdOnStore) {
+        this.createdOnStore = createdOnStore;
     }
 
-
-
     public Storage.ImageFormat getFormat() {
         return format;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79209c13/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 05ff0da..22dd955 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -894,114 +894,6 @@ CREATE VIEW `cloud`.`host_view` AS
             and async_job.instance_type = 'Host'
             and async_job.job_status = 0;
         
-DROP VIEW IF EXISTS `cloud`.`volume_view`;
-CREATE VIEW `cloud`.`volume_view` AS
-    select 
-        volumes.id,
-        volumes.uuid,
-        volumes.name,
-        volumes.device_id,
-        volumes.volume_type,
-        volumes.size,
-        volumes.min_iops,
-        volumes.max_iops,
-        volumes.created,
-        volumes.state,
-        volumes.attached,
-        volumes.removed,
-        volumes.pod_id,
-        account.id account_id,
-        account.uuid account_uuid,
-        account.account_name account_name,
-        account.type account_type,
-        domain.id domain_id,
-        domain.uuid domain_uuid,
-        domain.name domain_name,
-        domain.path domain_path,
-        projects.id project_id,
-        projects.uuid project_uuid,
-        projects.name project_name,
-        data_center.id data_center_id,
-        data_center.uuid data_center_uuid,
-        data_center.name data_center_name,
-        data_center.networktype data_center_type,
-        vm_instance.id vm_id,
-        vm_instance.uuid vm_uuid,
-        vm_instance.name vm_name,
-        vm_instance.state vm_state,
-        vm_instance.vm_type,
-        user_vm.display_name vm_display_name,
-        volume_host_ref.size volume_host_size,
-        volume_host_ref.created volume_host_created,
-        volume_host_ref.format,
-        volume_host_ref.download_pct,
-        volume_host_ref.download_state,
-        volume_host_ref.error_str,
-        disk_offering.id disk_offering_id,
-        disk_offering.uuid disk_offering_uuid,
-        disk_offering.name disk_offering_name,
-        disk_offering.display_text disk_offering_display_text,
-        disk_offering.use_local_storage,
-        disk_offering.system_use,
-        disk_offering.bytes_read_rate,
-        disk_offering.bytes_write_rate,
-        disk_offering.iops_read_rate,
-        disk_offering.iops_write_rate,
-        storage_pool.id pool_id,
-        storage_pool.uuid pool_uuid,
-        storage_pool.name pool_name,
-        cluster.hypervisor_type,
-        vm_template.id template_id,
-        vm_template.uuid template_uuid,
-        vm_template.extractable,
-        vm_template.type template_type,
-        resource_tags.id tag_id,
-        resource_tags.uuid tag_uuid,
-        resource_tags.key tag_key,
-        resource_tags.value tag_value,
-        resource_tags.domain_id tag_domain_id,
-        resource_tags.account_id tag_account_id,
-        resource_tags.resource_id tag_resource_id,
-        resource_tags.resource_uuid tag_resource_uuid,
-        resource_tags.resource_type tag_resource_type,
-        resource_tags.customer tag_customer,
-        async_job.id job_id,
-        async_job.uuid job_uuid,
-        async_job.job_status job_status,
-        async_job.account_id job_account_id
-    from
-        `cloud`.`volumes`
-            inner join
-        `cloud`.`account` ON volumes.account_id = account.id
-            inner join
-        `cloud`.`domain` ON volumes.domain_id = domain.id
-            left join
-        `cloud`.`projects` ON projects.project_account_id = account.id
-            left join
-        `cloud`.`data_center` ON volumes.data_center_id = data_center.id
-            left join
-        `cloud`.`vm_instance` ON volumes.instance_id = vm_instance.id
-            left join
-        `cloud`.`user_vm` ON user_vm.id = vm_instance.id
-            left join
-        `cloud`.`volume_host_ref` ON volumes.id = volume_host_ref.volume_id
-            and volumes.data_center_id = volume_host_ref.zone_id
-            left join
-        `cloud`.`disk_offering` ON volumes.disk_offering_id = disk_offering.id
-            left join
-        `cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id
-            left join
-        `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id
-            left join
-        `cloud`.`vm_template` ON volumes.template_id = vm_template.id
-            left join
-        `cloud`.`resource_tags` ON resource_tags.resource_id = volumes.id
-            and resource_tags.resource_type = 'Volume'
-            left join
-        `cloud`.`async_job` ON async_job.instance_id = volumes.id
-            and async_job.instance_type = 'Volume'
-            and async_job.job_status = 0;                       
- 
 DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;
 CREATE VIEW `cloud`.`storage_pool_view` AS
     select 
@@ -1782,6 +1674,7 @@ CREATE VIEW `cloud`.`volume_view` AS
         volumes.removed,
         volumes.pod_id,
 	volumes.display_volume,
+        volumes.format,
         account.id account_id,
         account.uuid account_uuid,
         account.account_name account_name,
@@ -1803,12 +1696,11 @@ CREATE VIEW `cloud`.`volume_view` AS
         vm_instance.state vm_state,
         vm_instance.vm_type,
         user_vm.display_name vm_display_name,
-        volume_host_ref.size volume_host_size,
-        volume_host_ref.created volume_host_created,
-        volume_host_ref.format,
-        volume_host_ref.download_pct,
-        volume_host_ref.download_state,
-        volume_host_ref.error_str,
+        volume_store_ref.size volume_store_size,
+        volume_store_ref.download_pct,
+        volume_store_ref.download_state,
+        volume_store_ref.error_str,
+        volume_store_ref.created created_on_store,
         disk_offering.id disk_offering_id,
         disk_offering.uuid disk_offering_uuid,
         disk_offering.name disk_offering_name,
@@ -1856,8 +1748,7 @@ CREATE VIEW `cloud`.`volume_view` AS
             left join
         `cloud`.`user_vm` ON user_vm.id = vm_instance.id
             left join
-        `cloud`.`volume_host_ref` ON volumes.id = volume_host_ref.volume_id
-            and volumes.data_center_id = volume_host_ref.zone_id
+        `cloud`.`volume_store_ref` ON volumes.id = volume_store_ref.volume_id
             left join
         `cloud`.`disk_offering` ON volumes.disk_offering_id = disk_offering.id
             left join


Mime
View raw message