cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/5] git commit: updated refs/heads/volume-upload to bc997f1
Date Tue, 17 Feb 2015 06:11:36 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload 121ff19cb -> bc997f1ac


volume upload: returning the install path and size in UploadStatusCommand


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

Branch: refs/heads/volume-upload
Commit: 01c41d09db724de315b9ccd6a193c7b0d54586bb
Parents: 121ff19
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Sat Jan 31 16:20:29 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Tue Feb 17 11:28:32 2015 +0530

----------------------------------------------------------------------
 .../storage/resource/NfsSecondaryStorageResource.java    | 11 ++++++++---
 .../apache/cloudstack/storage/template/UploadEntity.java |  8 ++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01c41d09/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 907d4ff..3ef881c 100755
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -1725,11 +1725,15 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
         if (uploadEntityStateMap.containsKey(entityId)) {
             UploadEntity uploadEntity = uploadEntityStateMap.get(entityId);
             if (uploadEntity.getUploadState()== UploadEntity.Status.ERROR) {
-                uploadEntityStateMap.remove(uploadEntity);
+                uploadEntityStateMap.remove(entityId);
                 return new UploadStatusAnswer(cmd, UploadStatus.ERROR, uploadEntity.getErrorMessage());
             }else if (uploadEntity.getUploadState()== UploadEntity.Status.COMPLETED) {
-                uploadEntityStateMap.remove(uploadEntity);
-                return new UploadStatusAnswer(cmd, UploadStatus.COMPLETED);
+                UploadStatusAnswer answer =  new UploadStatusAnswer(cmd, UploadStatus.COMPLETED);
+                answer.setVirtualSize(uploadEntity.getVirtualSize());
+                answer.setInstallPath(uploadEntity.getTmpltPath());
+                answer.setPhysicalSize(uploadEntity.getEntitysize());
+                uploadEntityStateMap.remove(entityId);
+                return answer;
             }else if (uploadEntity.getUploadState()==UploadEntity.Status.IN_PROGRESS) {
                 return new UploadStatusAnswer(cmd,UploadStatus.IN_PROGRESS);
             }
@@ -2833,6 +2837,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
                 }
                 if (info != null) {
                     loc.addFormat(info);
+                    uploadEntity.setVirtualSize(info.virtualSize);
                     //dnld.setTemplatesize(info.virtualSize);
                     //dnld.setTemplatePhysicalSize(info.size);
                     break;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01c41d09/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadEntity.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadEntity.java
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadEntity.java
index 3066c6b..8d3d021 100644
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadEntity.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadEntity.java
@@ -49,6 +49,7 @@ public class UploadEntity {
     private String errorMessage=null;
     private File file;
     private ResourceType resourceType;
+    private long virtualSize;
 
     public static long s_maxTemplateSize = 50L * 1024L * 1024L * 1024L;
 
@@ -173,4 +174,11 @@ public class UploadEntity {
         this.chksum = chksum;
     }
 
+    public long getVirtualSize() {
+        return virtualSize;
+    }
+
+    public void setVirtualSize(long virtualSize) {
+        this.virtualSize = virtualSize;
+    }
 }


Mime
View raw message