cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [3/3] git commit: updated refs/heads/object_store to a715eb8
Date Fri, 14 Jun 2013 23:11:18 GMT
clean up storage related code, and add lru replacement algorithm for cache storage


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

Branch: refs/heads/object_store
Commit: a715eb8121b3e9b6bb61fe3db150580b22e4b3aa
Parents: 0acce2c
Author: Edison Su <edison.su@citrix.com>
Authored: Fri Jun 14 15:55:44 2013 -0700
Committer: Edison Su <edison.su@citrix.com>
Committed: Fri Jun 14 15:55:59 2013 -0700

----------------------------------------------------------------------
 agent/src/com/cloud/agent/AgentShell.java       |   1 +
 api/src/com/cloud/storage/StoragePool.java      |   2 +-
 client/tomcatconf/applicationContext.xml.in     |   1 +
 client/tomcatconf/log4j-cloud.xml.in            |   4 +
 .../agent/test/BackupSnapshotCommandTest.java   |   2 +-
 .../api/agent/test/CheckNetworkAnswerTest.java  | 205 ++++++++++++
 .../api/agent/test/SnapshotCommandTest.java     |   2 +-
 .../agent/api/test/ResizeVolumeCommandTest.java | 229 --------------
 .../subsystem/api/storage/ClusterScope.java     |   1 +
 .../api/storage/DataMigrationSubSystem.java     |  30 --
 .../api/storage/DataMotionService.java          |   4 +-
 .../api/storage/DataMotionStrategy.java         |   8 +-
 .../subsystem/api/storage/DataObject.java       |  25 +-
 .../api/storage/DataObjectInStore.java          |  10 +-
 .../subsystem/api/storage/DataStoreDriver.java  |  27 +-
 .../api/storage/DataStoreLifeCycle.java         |  16 +-
 .../subsystem/api/storage/DataStoreManager.java |  18 +-
 .../api/storage/DataStoreProvider.java          |  25 +-
 .../api/storage/DataStoreProviderManager.java   |  11 +-
 .../engine/subsystem/api/storage/EndPoint.java  |  10 +-
 .../subsystem/api/storage/EndPointSelector.java |  10 +-
 .../engine/subsystem/api/storage/HostScope.java |   1 +
 .../api/storage/ImageStoreProvider.java         |   4 +-
 .../api/storage/PrimaryDataStoreDriver.java     |   4 +-
 .../api/storage/PrimaryDataStoreInfo.java       |  12 +-
 .../engine/subsystem/api/storage/Scope.java     |   6 +-
 .../api/storage/SnapshotDataFactory.java        |   6 +-
 .../subsystem/api/storage/SnapshotInfo.java     |  10 +-
 .../subsystem/api/storage/SnapshotService.java  |   8 +-
 .../subsystem/api/storage/SnapshotStrategy.java |  10 +-
 .../api/storage/StorageCacheManager.java        |   8 +-
 .../api/storage/StorageOrchestrator.java        |  76 -----
 .../api/storage/StoragePoolAllocator.java       |   2 +-
 .../subsystem/api/storage/StorageSubSystem.java |  31 --
 .../subsystem/api/storage/TemplateInfo.java     |   4 +-
 .../subsystem/api/storage/TemplateProfile.java  | 312 -------------------
 .../subsystem/api/storage/TemplateService.java  |   2 +-
 .../subsystem/api/storage/VolumeInfo.java       |  18 +-
 .../subsystem/api/storage/VolumeProfile.java    |  35 ---
 .../subsystem/api/storage/VolumeService.java    |   3 +-
 .../engine/subsystem/api/storage/ZoneScope.java |   1 +
 .../storage/command/CreateObjectCommand.java    |   1 -
 .../storage/datastore/db/ImageStoreDao.java     |  10 +-
 .../storage/datastore/db/ImageStoreVO.java      |  10 +
 .../datastore/db/PrimaryDataStoreDaoImpl.java   |   2 +-
 .../datastore/db/SnapshotDataStoreDao.java      |  10 +-
 .../datastore/db/SnapshotDataStoreVO.java       |  15 +
 .../storage/datastore/db/StoragePoolVO.java     |  16 +-
 .../datastore/db/TemplateDataStoreDao.java      |   8 +-
 .../datastore/db/TemplateDataStoreVO.java       |  21 +-
 .../datastore/db/VolumeDataStoreDao.java        |  12 +-
 .../storage/datastore/db/VolumeDataStoreVO.java |  19 +-
 .../storage/image/datastore/ImageStoreInfo.java |   4 +-
 .../cloudstack/storage/to/ImageStoreTO.java     |   9 +-
 .../storage/to/PrimaryDataStoreTO.java          |   6 +
 .../cloudstack/storage/to/SnapshotObjectTO.java |   6 +
 .../cloudstack/storage/to/TemplateObjectTO.java |   6 +
 .../cloudstack/storage/to/VolumeObjectTO.java   |   6 +
 .../cache/manager/StorageCacheManagerImpl.java  | 156 +++++++---
 .../StorageCacheReplacementAlgorithm.java       |  26 ++
 .../StorageCacheReplacementAlgorithmLRU.java    | 106 +++++++
 .../motion/AncientDataMotionStrategy.java       |  15 +-
 .../storage/motion/DataMotionDriver.java        |  25 --
 .../storage/image/ImageOrchestrator.java        |  29 --
 .../storage/image/TemplateServiceImpl.java      |   2 -
 .../image/downloader/ImageDownloader.java       |  25 --
 .../manager/ImageStoreProviderManagerImpl.java  |   1 -
 .../storage/image/store/ImageStoreImpl.java     |  10 +-
 .../storage/image/store/TemplateObject.java     |  42 +++
 .../storage/allocator/StorageAllocatorTest.java |   4 +-
 ...StorageCacheReplacementAlgorithmLRUTest.java | 226 ++++++++++++++
 .../cloudstack/storage/test/SnapshotTest.java   | 101 +++---
 .../cloudstack/storage/test/VolumeTest.java     |  79 +++--
 .../test/resource/storageContext.xml            |   5 +-
 .../storage/snapshot/SnapshotObject.java        |  44 ++-
 .../storage/snapshot/SnapshotServiceImpl.java   |  44 +--
 .../snapshot/SnapshotStateMachineManager.java   |   2 +-
 .../snapshot/XenserverSnapshotStrategy.java     |   1 -
 .../storage/snapshot/db/SnapshotDao2.java       |  25 --
 .../storage/snapshot/db/SnapshotDao2Impl.java   |  28 --
 .../storage/snapshot/db/SnapshotVO.java         | 296 ------------------
 .../storage/datastore/DataStoreManagerImpl.java |  10 -
 .../datastore/PrimaryDataStoreEntityImpl.java   |   2 +-
 .../provider/DataStoreProviderManagerImpl.java  |   6 -
 .../storage/image/BaseImageStoreDriverImpl.java |  28 --
 .../datastore/PrimaryDataStoreHelper.java       |   4 +-
 .../storage/datastore/PrimaryDataStoreImpl.java |   9 +-
 .../driver/PrimaryDataStoreDriver.java          |  16 -
 .../datastore/provider/DefaultHostListener.java |   2 +-
 .../storage/volume/VolumeEntityImpl.java        | 201 ------------
 .../cloudstack/storage/volume/VolumeObject.java |  41 +++
 .../storage/volume/VolumeServiceImpl.java       |  33 +-
 .../CloudStackImageStoreLifeCycleImpl.java      |  18 --
 .../lifecycle/S3ImageStoreLifeCycleImpl.java    |  28 --
 .../driver/SampleImageStoreDriverImpl.java      |   3 -
 .../SampleImageStoreLifeCycleImpl.java          |  18 --
 .../provider/SampleImageStoreProviderImpl.java  |   2 -
 .../driver/SwiftImageStoreDriverImpl.java       |   3 -
 .../lifecycle/SwiftImageStoreLifeCycleImpl.java |  48 +--
 .../CloudStackPrimaryDataStoreDriverImpl.java   |  56 +---
 ...CloudStackPrimaryDataStoreLifeCycleImpl.java |  12 -
 .../SamplePrimaryDataStoreDriverImpl.java       |  87 +-----
 .../SamplePrimaryDataStoreLifeCycleImpl.java    |  43 +--
 .../SamplePrimaryDatastoreProviderImpl.java     |   2 -
 .../driver/SolidfirePrimaryDataStoreDriver.java |  47 +--
 .../SolidfirePrimaryDataStoreProvider.java      |  10 -
 server/src/com/cloud/configuration/Config.java  |   5 +-
 server/src/com/cloud/server/StatsCollector.java |  89 ------
 setup/db/db/schema-410to420.sql                 |   7 +-
 test/pom.xml                                    |   2 +-
 110 files changed, 1226 insertions(+), 2253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/agent/src/com/cloud/agent/AgentShell.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index cf454b8..e7f114b 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -82,6 +82,7 @@ public class AgentShell implements IAgentShell, Daemon {
     private int _pingRetries;
     private final List<Agent> _agents = new ArrayList<Agent>();
 
+
     public AgentShell() {
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/api/src/com/cloud/storage/StoragePool.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/StoragePool.java b/api/src/com/cloud/storage/StoragePool.java
index 8b95383..8f8b864 100644
--- a/api/src/com/cloud/storage/StoragePool.java
+++ b/api/src/com/cloud/storage/StoragePool.java
@@ -58,7 +58,7 @@ public interface StoragePool extends Identity, InternalIdentity {
     /**
      * @return available storage in bytes
      */
-    long getAvailableBytes();
+    long getUsedBytes();
 
     Long getClusterId();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 8d251ee..181219a 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -815,6 +815,7 @@
   <bean id="swiftImageStoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl" />  
   <bean id="ApplicationLoadBalancerService" class="org.apache.cloudstack.network.lb.ApplicationLoadBalancerManagerImpl" />
   <bean id="InternalLoadBalancerVMManager" class="org.apache.cloudstack.network.lb.InternalLoadBalancerVMManagerImpl" />
+  <bean id="StorageCacheReplacementAlgorithm" class="org.apache.cloudstack.storage.cache.manager.StorageCacheReplacementAlgorithmLRU" />
 
 
 <!--=======================================================================================================-->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/client/tomcatconf/log4j-cloud.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/log4j-cloud.xml.in b/client/tomcatconf/log4j-cloud.xml.in
index 0e7f004..fc1c29e 100755
--- a/client/tomcatconf/log4j-cloud.xml.in
+++ b/client/tomcatconf/log4j-cloud.xml.in
@@ -132,6 +132,10 @@ under the License.
       <priority value="INFO"/>
    </category>
 
+   <category name="org.apache.cloudstack">
+      <priority value="DEBUG"/>
+   </category>
+
    <category name="org.apache.cloudstack.api.command">
       <priority value="TRACE"/>
    </category>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/core/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
----------------------------------------------------------------------
diff --git a/core/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java b/core/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
index 40083a8..9890593 100644
--- a/core/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
+++ b/core/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
@@ -83,7 +83,7 @@ public class BackupSnapshotCommandTest {
         };
 
         @Override
-        public long getAvailableBytes() {
+        public long getUsedBytes() {
             return 0L;
         };
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/core/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
----------------------------------------------------------------------
diff --git a/core/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java b/core/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
index 1853d39..4db6557 100644
--- a/core/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
+++ b/core/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
@@ -16,9 +16,15 @@
 // under the License.
 package org.apache.cloudstack.api.agent.test;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import com.cloud.agent.api.storage.ResizeVolumeCommand;
+import com.cloud.agent.api.to.StorageFilerTO;
+import com.cloud.storage.Storage;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.StoragePoolStatus;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -26,6 +32,10 @@ import org.mockito.Mockito;
 import com.cloud.agent.api.CheckNetworkAnswer;
 import com.cloud.agent.api.CheckNetworkCommand;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 public class CheckNetworkAnswerTest {
     CheckNetworkCommand cnc;
     CheckNetworkAnswer cna;
@@ -59,4 +69,199 @@ public class CheckNetworkAnswerTest {
         boolean b = cna.executeInSequence();
         assertFalse(b);
     }
+
+    public static class ResizeVolumeCommandTest {
+
+        public StoragePool dummypool = new StoragePool() {
+            @Override
+            public long getId() {
+                return 1L;
+            };
+
+            @Override
+            public String getName() {
+                return "name";
+            };
+
+            @Override
+            public String getUuid() {
+                return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
+            };
+
+            @Override
+            public Storage.StoragePoolType getPoolType() {
+                return Storage.StoragePoolType.Filesystem;
+            };
+
+            @Override
+            public Date getCreated() {
+                Date date = null;
+                try {
+                    date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
+                    .parse("01/01/1970 12:12:12");
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
+                return date;
+            }
+
+            @Override
+            public Date getUpdateTime() {
+                return new Date();
+            };
+
+            @Override
+            public long getDataCenterId() {
+                return 0L;
+            };
+
+            @Override
+            public long getCapacityBytes() {
+                return 0L;
+            };
+
+            @Override
+            public long getUsedBytes() {
+                return 0L;
+            };
+
+            @Override
+            public Long getClusterId() {
+                return 0L;
+            };
+
+            @Override
+            public String getHostAddress() {
+                return "hostAddress";
+            };
+
+            @Override
+            public String getPath() {
+                return "path";
+            };
+
+            @Override
+            public String getUserInfo() {
+                return "userInfo";
+            };
+
+            @Override
+            public boolean isShared() {
+                return false;
+            };
+
+            @Override
+            public boolean isLocal() {
+                return false;
+            };
+
+            @Override
+            public StoragePoolStatus getStatus() {
+                return StoragePoolStatus.Up;
+            };
+
+            @Override
+            public int getPort() {
+                return 25;
+            };
+
+            @Override
+            public Long getPodId() {
+                return 0L;
+            }
+
+            @Override
+            public String getStorageProviderName() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public boolean isInMaintenance() {
+                // TODO Auto-generated method stub
+                return false;
+            };
+        };
+
+        Long newSize = 4194304L;
+        Long currentSize = 1048576L;
+
+        ResizeVolumeCommand rv = new ResizeVolumeCommand("dummydiskpath",
+                new StorageFilerTO(dummypool), currentSize, newSize, false,
+                "vmName");
+
+        @Test
+        public void testExecuteInSequence() {
+            boolean b = rv.executeInSequence();
+            assertFalse(b);
+        }
+
+        @Test
+        public void testGetPath() {
+            String path = rv.getPath();
+            assertTrue(path.equals("dummydiskpath"));
+        }
+
+        @Test
+        public void testGetPoolUuid() {
+            String poolUuid = rv.getPoolUuid();
+            assertTrue(poolUuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
+        }
+
+        @Test
+        public void testGetPool() {
+            StorageFilerTO pool = rv.getPool();
+
+            Long id = pool.getId();
+            Long expectedL = 1L;
+            assertEquals(expectedL, id);
+
+            String uuid = pool.getUuid();
+            assertTrue(uuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
+
+            String host = pool.getHost();
+            assertTrue(host.equals("hostAddress"));
+
+            String path = pool.getPath();
+            assertTrue(path.equals("path"));
+
+            String userInfo = pool.getUserInfo();
+            assertTrue(userInfo.equals("userInfo"));
+
+            Integer port = pool.getPort();
+            Integer expectedI = 25;
+            assertEquals(expectedI, port);
+
+            Storage.StoragePoolType type = pool.getType();
+            assertEquals(Storage.StoragePoolType.Filesystem, type);
+
+            String str = pool.toString();
+            assertTrue(str.equals("Pool[" + id.toString() + "|" + host + ":"
+                    + port.toString() + "|" + path + "]"));
+        }
+
+        @Test
+        public void testGetNewSize() {
+            long newSize = rv.getNewSize();
+            assertTrue(newSize == 4194304L);
+        }
+
+        @Test
+        public void testGetCurrentSize() {
+            long currentSize = rv.getCurrentSize();
+            assertTrue(currentSize == 1048576L);
+        }
+
+        @Test
+        public void testGetShrinkOk() {
+            assertFalse(rv.getShrinkOk());
+        }
+
+        @Test
+        public void testGetInstanceName() {
+            String vmName = rv.getInstanceName();
+            assertTrue(vmName.equals("vmName"));
+        }
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/core/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
----------------------------------------------------------------------
diff --git a/core/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java b/core/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
index 56a1d22..3076d45 100644
--- a/core/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
+++ b/core/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
@@ -74,7 +74,7 @@ public class SnapshotCommandTest {
             return 0L;
         };
 
-        public long getAvailableBytes() {
+        public long getUsedBytes() {
             return 0L;
         };
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/core/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
----------------------------------------------------------------------
diff --git a/core/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java b/core/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
deleted file mode 100644
index 02085f5..0000000
--- a/core/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
+++ /dev/null
@@ -1,229 +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 src.com.cloud.agent.api.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.storage.ResizeVolumeCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-
-
-public class ResizeVolumeCommandTest {
-
-    public StoragePool dummypool = new StoragePool() {
-        @Override
-        public long getId() {
-            return 1L;
-        };
-
-        @Override
-        public String getName() {
-            return "name";
-        };
-
-        @Override
-        public String getUuid() {
-            return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
-        };
-
-        @Override
-        public StoragePoolType getPoolType() {
-            return StoragePoolType.Filesystem;
-        };
-
-        @Override
-        public Date getCreated() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                .parse("01/01/1970 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        @Override
-        public Date getUpdateTime() {
-            return new Date();
-        };
-
-        @Override
-        public long getDataCenterId() {
-            return 0L;
-        };
-
-        @Override
-        public long getCapacityBytes() {
-            return 0L;
-        };
-
-        @Override
-        public long getAvailableBytes() {
-            return 0L;
-        };
-
-        @Override
-        public Long getClusterId() {
-            return 0L;
-        };
-
-        @Override
-        public String getHostAddress() {
-            return "hostAddress";
-        };
-
-        @Override
-        public String getPath() {
-            return "path";
-        };
-
-        @Override
-        public String getUserInfo() {
-            return "userInfo";
-        };
-
-        @Override
-        public boolean isShared() {
-            return false;
-        };
-
-        @Override
-        public boolean isLocal() {
-            return false;
-        };
-
-        @Override
-        public StoragePoolStatus getStatus() {
-            return StoragePoolStatus.Up;
-        };
-
-        @Override
-        public int getPort() {
-            return 25;
-        };
-
-        @Override
-        public Long getPodId() {
-            return 0L;
-        }
-
-        @Override
-        public String getStorageProviderName() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public boolean isInMaintenance() {
-            // TODO Auto-generated method stub
-            return false;
-        };
-    };
-
-    Long newSize = 4194304L;
-    Long currentSize = 1048576L;
-
-    ResizeVolumeCommand rv = new ResizeVolumeCommand("dummydiskpath", 
-            new StorageFilerTO(dummypool), currentSize, newSize, false, 
-            "vmName");
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = rv.executeInSequence();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetPath() {
-        String path = rv.getPath();
-        assertTrue(path.equals("dummydiskpath"));
-    }
-
-    @Test
-    public void testGetPoolUuid() {
-        String poolUuid = rv.getPoolUuid();
-        assertTrue(poolUuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-    }
-
-    @Test
-    public void testGetPool() {
-        StorageFilerTO pool = rv.getPool();
-
-        Long id = pool.getId();
-        Long expectedL = 1L;
-        assertEquals(expectedL, id);
-
-        String uuid = pool.getUuid();
-        assertTrue(uuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-
-        String host = pool.getHost();
-        assertTrue(host.equals("hostAddress"));
-
-        String path = pool.getPath();
-        assertTrue(path.equals("path"));
-
-        String userInfo = pool.getUserInfo();
-        assertTrue(userInfo.equals("userInfo"));
-
-        Integer port = pool.getPort();
-        Integer expectedI = 25;
-        assertEquals(expectedI, port);
-
-        StoragePoolType type = pool.getType();
-        assertEquals(StoragePoolType.Filesystem, type);
-
-        String str = pool.toString();
-        assertTrue(str.equals("Pool[" + id.toString() + "|" + host + ":"
-                + port.toString() + "|" + path + "]"));
-    }
-
-    @Test
-    public void testGetNewSize() {
-        long newSize = rv.getNewSize();
-        assertTrue(newSize == 4194304L);
-    }
-
-    @Test
-    public void testGetCurrentSize() {
-        long currentSize = rv.getCurrentSize();
-        assertTrue(currentSize == 1048576L);
-    }
-
-    @Test
-    public void testGetShrinkOk() {
-        assertFalse(rv.getShrinkOk());
-    }
-
-    @Test
-    public void testGetInstanceName() {
-        String vmName = rv.getInstanceName();
-        assertTrue(vmName.equals("vmName"));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ClusterScope.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ClusterScope.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ClusterScope.java
index 15e6d45..b0ed7d7 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ClusterScope.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ClusterScope.java
@@ -27,6 +27,7 @@ public class ClusterScope extends AbstractScope {
     private Long zoneId;
 
     public ClusterScope(Long clusterId, Long podId, Long zoneId) {
+        super();
         this.clusterId = clusterId;
         this.podId = podId;
         this.zoneId = zoneId;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMigrationSubSystem.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMigrationSubSystem.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMigrationSubSystem.java
deleted file mode 100755
index ad81043..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMigrationSubSystem.java
+++ /dev/null
@@ -1,30 +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 org.apache.cloudstack.engine.subsystem.api.storage;
-
-import java.net.URI;
-
-import com.cloud.org.Grouping;
-
-public interface DataMigrationSubSystem {
-
-    Class<? extends Grouping> getScopeCoverage();
-
-    void migrate(URI source, URI dest, String reservationId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
index 5a124aa..5e10a0b 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
@@ -26,9 +26,9 @@ import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.host.Host;
 
 public interface DataMotionService {
-    public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
+    void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
 
-    public void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
+    void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
             AsyncCompletionCallback<CopyCommandResult> callback);
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
index 5bff21f..6deb6c1 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
@@ -26,13 +26,13 @@ import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.host.Host;
 
 public interface DataMotionStrategy {
-    public boolean canHandle(DataObject srcData, DataObject destData);
+    boolean canHandle(DataObject srcData, DataObject destData);
 
-    public boolean canHandle(Map<VolumeInfo, DataStore> volumeMap, Host srcHost, Host destHost);
+    boolean canHandle(Map<VolumeInfo, DataStore> volumeMap, Host srcHost, Host destHost);
 
-    public Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
+    Void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
 
-    public Void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
+    Void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
             AsyncCompletionCallback<CopyCommandResult> callback);
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java
index 0cd2111..c57b01c 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java
@@ -23,24 +23,29 @@ import com.cloud.agent.api.to.DataObjectType;
 import com.cloud.agent.api.to.DataTO;
 
 public interface DataObject {
-    public long getId();
+    long getId();
 
-    public String getUri();
+    String getUri();
 
-    public DataTO getTO();
+    DataTO getTO();
 
-    public DataStore getDataStore();
+    DataStore getDataStore();
 
-    public Long getSize();
+    Long getSize();
 
-    public DataObjectType getType();
+    DataObjectType getType();
 
-    // public DiskFormat getFormat();
-    public String getUuid();
+    String getUuid();
 
     boolean delete();
 
-    public void processEvent(ObjectInDataStoreStateMachine.Event event);
+    void processEvent(ObjectInDataStoreStateMachine.Event event);
 
-    public void processEvent(ObjectInDataStoreStateMachine.Event event, Answer answer);
+    void processEvent(ObjectInDataStoreStateMachine.Event event, Answer answer);
+
+    void incRefCount();
+
+    void decRefCount();
+
+    Long getRefCount();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectInStore.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectInStore.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectInStore.java
index 929774c..95bb9b9 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectInStore.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectInStore.java
@@ -21,13 +21,13 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.utils.fsm.StateObject;
 
 public interface DataObjectInStore extends StateObject<ObjectInDataStoreStateMachine.State> {
-    public String getInstallPath();
+    String getInstallPath();
 
-    public void setInstallPath(String path);
+    void setInstallPath(String path);
 
-    public long getObjectId();
+    long getObjectId();
 
-    public long getDataStoreId();
+    long getDataStoreId();
 
-    public ObjectInDataStoreStateMachine.State getObjectInStoreState();
+    ObjectInDataStoreStateMachine.State getObjectInStoreState();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
index 2143080..1cb6e15 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreDriver.java
@@ -18,32 +18,23 @@
  */
 package org.apache.cloudstack.engine.subsystem.api.storage;
 
-import java.util.Set;
-
-import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.storage.command.CommandResult;
-
 import com.cloud.agent.api.to.DataStoreTO;
 import com.cloud.agent.api.to.DataTO;
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.storage.command.CommandResult;
 
 public interface DataStoreDriver {
-    public String grantAccess(DataObject data, EndPoint ep);
-
-    public boolean revokeAccess(DataObject data, EndPoint ep);
-
-    public Set<DataObject> listObjects(DataStore store);
-
-    public void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
+    void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
 
-    public void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback);
+    void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback);
 
-    public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
+    void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
 
-    public boolean canCopy(DataObject srcData, DataObject destData);
+    boolean canCopy(DataObject srcData, DataObject destData);
 
-    public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
+    void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
 
-    public DataTO getTO(DataObject data);
+    DataTO getTO(DataObject data);
 
-    public DataStoreTO getStoreTO(DataStore store);
+    DataStoreTO getStoreTO(DataStore store);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
index bd8c6e0..1e893db 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
@@ -24,21 +24,17 @@ import com.cloud.agent.api.StoragePoolInfo;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 
 public interface DataStoreLifeCycle {
-    public DataStore initialize(Map<String, Object> dsInfos);
+    DataStore initialize(Map<String, Object> dsInfos);
 
-    public boolean attachCluster(DataStore store, ClusterScope scope);
+    boolean attachCluster(DataStore store, ClusterScope scope);
 
-    public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo);
+    boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo);
 
     boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType);
 
-    public boolean dettach();
+    boolean maintain(DataStore store);
 
-    public boolean unmanaged();
+    boolean cancelMaintain(DataStore store);
 
-    public boolean maintain(DataStore store);
-
-    public boolean cancelMaintain(DataStore store);
-
-    public boolean deleteDataStore(DataStore store);
+    boolean deleteDataStore(DataStore store);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreManager.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreManager.java
index 8617eb4..949b037 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreManager.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreManager.java
@@ -24,21 +24,17 @@ import java.util.Map;
 import com.cloud.storage.DataStoreRole;
 
 public interface DataStoreManager {
-    public DataStore getDataStore(long storeId, DataStoreRole role);
+    DataStore getDataStore(long storeId, DataStoreRole role);
 
-    public DataStore getPrimaryDataStore(long storeId);
+    DataStore getPrimaryDataStore(long storeId);
 
-    public DataStore getDataStore(String uuid, DataStoreRole role);
+    DataStore getDataStore(String uuid, DataStoreRole role);
 
-    public List<DataStore> getImageStoresByScope(ZoneScope scope);
+    List<DataStore> getImageStoresByScope(ZoneScope scope);
 
-    public DataStore getImageStore(long zoneId);
+    DataStore getImageStore(long zoneId);
 
-    public List<DataStore> getImageStoresByProvider(String provider);
+    List<DataStore> getImageCacheStores(Scope scope);
 
-    public List<DataStore> getImageCacheStores(Scope scope);
-
-    public DataStore registerDataStore(Map<String, String> params, String providerUuid);
-
-    public List<DataStore> listImageStores();
+    List<DataStore> listImageStores();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java
index a13c60b..855f085 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java
@@ -23,27 +23,26 @@ import java.util.Set;
 
 public interface DataStoreProvider {
     // constants for provider names
-    public static final String NFS_IMAGE = "NFS";
-    public static final String S3_IMAGE = "S3";
-    public static final String SWIFT_IMAGE = "Swift";
-    public static final String SAMPLE_IMAGE = "Sample";
+    static final String NFS_IMAGE = "NFS";
+    static final String S3_IMAGE = "S3";
+    static final String SWIFT_IMAGE = "Swift";
+    static final String SAMPLE_IMAGE = "Sample";
 
-    public static final String DEFAULT_PRIMARY = "DefaultPrimary";
+    static final String DEFAULT_PRIMARY = "DefaultPrimary";
 
-    public static enum DataStoreProviderType {
+    static enum DataStoreProviderType {
         PRIMARY, IMAGE, ImageCache
     }
 
-    public DataStoreLifeCycle getDataStoreLifeCycle();
+    DataStoreLifeCycle getDataStoreLifeCycle();
 
-    public DataStoreDriver getDataStoreDriver();
+    DataStoreDriver getDataStoreDriver();
 
-    public HypervisorHostListener getHostListener();
+    HypervisorHostListener getHostListener();
 
-    public String getName();
+    String getName();
 
-    public boolean configure(Map<String, Object> params);
-
-    public Set<DataStoreProviderType> getTypes();
+    boolean configure(Map<String, Object> params);
 
+    Set<DataStoreProviderType> getTypes();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProviderManager.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProviderManager.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProviderManager.java
index 84272ef..d25e10e 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProviderManager.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProviderManager.java
@@ -24,14 +24,11 @@ import com.cloud.storage.DataStoreProviderApiService;
 import com.cloud.utils.component.Manager;
 
 public interface DataStoreProviderManager extends Manager, DataStoreProviderApiService {
-    public DataStoreProvider getDataStoreProvider(String name);
+    DataStoreProvider getDataStoreProvider(String name);
 
-    public DataStoreProvider getDefaultPrimaryDataStoreProvider();
+    DataStoreProvider getDefaultPrimaryDataStoreProvider();
 
-    public DataStoreProvider getDefaultImageDataStoreProvider();
-
-    public DataStoreProvider getDefaultCacheDataStoreProvider();
-
-    public List<DataStoreProvider> getDataStoreProviders();
+    DataStoreProvider getDefaultImageDataStoreProvider();
 
+    DataStoreProvider getDefaultCacheDataStoreProvider();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
index ed9c0eb..254c91d 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
@@ -22,13 +22,13 @@ import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 
 public interface EndPoint {
-    public long getId();
+    long getId();
 
-    public String getHostAddr();
+    String getHostAddr();
 
-    public String getPublicAddr();
+    String getPublicAddr();
 
-    public Answer sendMessage(Command cmd);
+    Answer sendMessage(Command cmd);
 
-    public void sendMessageAsync(Command cmd, AsyncCompletionCallback<Answer> callback);
+    void sendMessageAsync(Command cmd, AsyncCompletionCallback<Answer> callback);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java
index a51fad8..ca0cc2c 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPointSelector.java
@@ -21,19 +21,11 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import java.util.List;
 
 public interface EndPointSelector {
-    public EndPoint select(DataObject srcData, DataObject destData);
+    EndPoint select(DataObject srcData, DataObject destData);
 
-    /**
-     * @param object
-     * @return
-     */
     EndPoint select(DataObject object);
 
     EndPoint select(DataStore store);
 
-    /**
-     * @param store
-     * @return
-     */
     List<EndPoint> selectAll(DataStore store);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/HostScope.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/HostScope.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/HostScope.java
index ff33077..1ff3818 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/HostScope.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/HostScope.java
@@ -25,6 +25,7 @@ public class HostScope extends AbstractScope {
     private Long zoneId;
 
     public HostScope(Long hostId, Long zoneId) {
+        super();
         this.hostId = hostId;
         this.zoneId = zoneId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
index bde4fe4..0025ae1 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
@@ -22,7 +22,7 @@ import com.cloud.storage.ScopeType;
 
 public interface ImageStoreProvider extends DataStoreProvider {
 
-    public boolean isScopeSupported(ScopeType scope);
+    boolean isScopeSupported(ScopeType scope);
 
-    public boolean needDownloadSysTemplate();
+    boolean needDownloadSysTemplate();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
index ee35557..2528a53 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java
@@ -22,7 +22,7 @@ import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.storage.command.CommandResult;
 
 public interface PrimaryDataStoreDriver extends DataStoreDriver {
-    public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback);
+    void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback);
 
-    public void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CommandResult> callback);
+    void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CommandResult> callback);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
index c69cd3a..95a5cc9 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
@@ -25,15 +25,15 @@ import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.StoragePool;
 
 public interface PrimaryDataStoreInfo extends StoragePool {
-    public boolean isHypervisorSupported(HypervisorType hypervisor);
+    boolean isHypervisorSupported(HypervisorType hypervisor);
 
-    public boolean isLocalStorageSupported();
+    boolean isLocalStorageSupported();
 
-    public boolean isVolumeDiskTypeSupported(DiskFormat diskType);
+    boolean isVolumeDiskTypeSupported(DiskFormat diskType);
 
-    public String getUuid();
+    String getUuid();
 
-    public StoragePoolType getPoolType();
+    StoragePoolType getPoolType();
 
-    public PrimaryDataStoreLifeCycle getLifeCycle();
+    PrimaryDataStoreLifeCycle getLifeCycle();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/Scope.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/Scope.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/Scope.java
index 5c71f3c..8e43fa0 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/Scope.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/Scope.java
@@ -21,9 +21,9 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.storage.ScopeType;
 
 public interface Scope {
-    public ScopeType getScopeType();
+    ScopeType getScopeType();
 
-    public boolean isSameScope(Scope scope);
+    boolean isSameScope(Scope scope);
 
-    public Long getScopeId();
+    Long getScopeId();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java
index 04b67d4..0b8d1f1 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java
@@ -21,9 +21,9 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.storage.DataStoreRole;
 
 public interface SnapshotDataFactory {
-    public SnapshotInfo getSnapshot(long snapshotId, DataStore store);
+    SnapshotInfo getSnapshot(long snapshotId, DataStore store);
 
-    public SnapshotInfo getSnapshot(DataObject obj, DataStore store);
+    SnapshotInfo getSnapshot(DataObject obj, DataStore store);
 
-    public SnapshotInfo getSnapshot(long snapshotId, DataStoreRole role);
+    SnapshotInfo getSnapshot(long snapshotId, DataStoreRole role);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java
index 91e0fd7..8d6b760 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java
@@ -19,15 +19,15 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.storage.Snapshot;
 
 public interface SnapshotInfo extends DataObject, Snapshot {
-    public SnapshotInfo getParent();
+    SnapshotInfo getParent();
 
-    public String getPath();
+    String getPath();
 
-    public SnapshotInfo getChild();
+    SnapshotInfo getChild();
 
-    public VolumeInfo getBaseVolume();
+    VolumeInfo getBaseVolume();
 
-    public void addPayload(Object data);
+    void addPayload(Object data);
 
     Long getDataCenterId();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotService.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotService.java
index 67c8847..d594a07 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotService.java
@@ -18,11 +18,11 @@
 package org.apache.cloudstack.engine.subsystem.api.storage;
 
 public interface SnapshotService {
-    public SnapshotResult takeSnapshot(SnapshotInfo snapshot);
+    SnapshotResult takeSnapshot(SnapshotInfo snapshot);
 
-    public SnapshotInfo backupSnapshot(SnapshotInfo snapshot);
+    SnapshotInfo backupSnapshot(SnapshotInfo snapshot);
 
-    public boolean deleteSnapshot(SnapshotInfo snapshot);
+    boolean deleteSnapshot(SnapshotInfo snapshot);
 
-    public boolean revertSnapshot(SnapshotInfo snapshot);
+    boolean revertSnapshot(SnapshotInfo snapshot);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotStrategy.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotStrategy.java
index 542246a..86ae532 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotStrategy.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotStrategy.java
@@ -19,15 +19,11 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.storage.Snapshot;
 
 public interface SnapshotStrategy {
-    public SnapshotInfo takeSnapshot(SnapshotInfo snapshot);
+    SnapshotInfo takeSnapshot(SnapshotInfo snapshot);
 
-    public SnapshotInfo backupSnapshot(SnapshotInfo snapshot);
+    SnapshotInfo backupSnapshot(SnapshotInfo snapshot);
 
-    public boolean deleteSnapshot(Long snapshotId);
+    boolean deleteSnapshot(Long snapshotId);
 
-    /**
-     * @param snapshot
-     * @return
-     */
     boolean canHandle(Snapshot snapshot);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java
index fd5211f..92724c9 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java
@@ -19,9 +19,9 @@
 package org.apache.cloudstack.engine.subsystem.api.storage;
 
 public interface StorageCacheManager {
-    public DataStore getCacheStorage(Scope scope);
+    DataStore getCacheStorage(Scope scope);
 
-    public DataObject createCacheObject(DataObject data, Scope scope);
+    DataObject createCacheObject(DataObject data, Scope scope);
 
     /**
      * only create cache object in db
@@ -33,4 +33,8 @@ public interface StorageCacheManager {
     DataObject getCacheObject(DataObject data, Scope scope);
 
     boolean deleteCacheObject(DataObject data);
+
+    boolean releaseCacheObject(DataObject data);
+
+    DataObject createCacheObject(DataObject data, DataStore store);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageOrchestrator.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageOrchestrator.java
deleted file mode 100755
index d4455c8..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageOrchestrator.java
+++ /dev/null
@@ -1,76 +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 org.apache.cloudstack.engine.subsystem.api.storage;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
-import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
-import org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeType;
-
-import com.cloud.deploy.DeploymentPlan;
-
-public interface StorageOrchestrator {
-
-    /**
-     * Prepares all storage ready for a VM to start
-     * 
-     * @param vm
-     * @param reservationId
-     */
-    void prepare(long vmId, DeploymentPlan plan, String reservationId);
-
-    /**
-     * Releases all storage that were used for a VM shutdown
-     * 
-     * @param vm
-     * @param disks
-     * @param reservationId
-     */
-    void release(long vmId, String reservationId);
-
-    /**
-     * Destroy all disks
-     * 
-     * @param disks
-     * @param reservationId
-     */
-    void destroy(List<Long> disks, String reservationId);
-
-    /**
-     * Cancel a reservation
-     * 
-     * @param reservationId
-     *            reservation to
-     */
-    void cancel(String reservationId);
-
-    /**
-     * If attaching a volume in allocated state to a running vm, need to create
-     * this volume
-     */
-    void prepareAttachDiskToVM(long diskId, long vmId, String reservationId);
-
-    boolean createVolume(VolumeEntity volume, long dataStoreId, DiskFormat diskType);
-
-    boolean createVolumeFromTemplate(VolumeEntity volume, long dataStoreId, DiskFormat dis, TemplateEntity template);
-
-    VolumeEntity allocateVolumeInDb(long size, VolumeType type, String volName, Long templateId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java
index 13eb0de..eccf0f4 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java
@@ -47,5 +47,5 @@ public interface StoragePoolAllocator extends Adapter {
     List<StoragePool> allocateToPool(DiskProfile dskCh, VirtualMachineProfile<? extends VirtualMachine> vmProfile,
             DeploymentPlan plan, ExcludeList avoid, int returnUpTo);
 
-    public static int RETURN_UPTO_ALL = -1;
+    static int RETURN_UPTO_ALL = -1;
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageSubSystem.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageSubSystem.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageSubSystem.java
deleted file mode 100644
index e5a74a4..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageSubSystem.java
+++ /dev/null
@@ -1,31 +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 org.apache.cloudstack.engine.subsystem.api.storage;
-
-import java.net.URI;
-
-import com.cloud.org.Grouping;
-
-public interface StorageSubSystem {
-    String getType();
-
-    Class<? extends Grouping> getScope();
-
-    URI grantAccess(String vol, String reservationId);
-
-    URI RemoveAccess(String vol, String reservationId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateInfo.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateInfo.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateInfo.java
index 91dba11..ceb5fc0 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateInfo.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateInfo.java
@@ -21,7 +21,7 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 import com.cloud.template.VirtualMachineTemplate;
 
 public interface TemplateInfo extends DataObject, VirtualMachineTemplate {
-    public String getUniqueName();
+    String getUniqueName();
 
-    public String getInstallPath();
+    String getInstallPath();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateProfile.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateProfile.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateProfile.java
deleted file mode 100755
index dcfd407..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateProfile.java
+++ /dev/null
@@ -1,312 +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 org.apache.cloudstack.engine.subsystem.api.storage;
-
-import java.util.Map;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.template.VirtualMachineTemplate;
-
-public class TemplateProfile {
-    Long userId;
-    String name;
-    String displayText;
-    Integer bits;
-    Boolean passwordEnabled;
-    Boolean sshKeyEnbaled;
-    Boolean requiresHvm;
-    String url;
-    Boolean isPublic;
-    Boolean featured;
-    Boolean isExtractable;
-    ImageFormat format;
-    Long guestOsId;
-    Long zoneId;
-    HypervisorType hypervisorType;
-    String accountName;
-    Long domainId;
-    Long accountId;
-    String chksum;
-    Boolean bootable;
-    Long templateId;
-    VirtualMachineTemplate template;
-    String templateTag;
-    Map details;
-
-    public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits,
-            Boolean passwordEnabled, Boolean requiresHvm, String url, Boolean isPublic, Boolean featured,
-            Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId, HypervisorType hypervisorType,
-            String accountName, Long domainId, Long accountId, String chksum, Boolean bootable, Map details,
-            Boolean sshKeyEnabled) {
-        this.templateId = templateId;
-        this.userId = userId;
-        this.name = name;
-        this.displayText = displayText;
-        this.bits = bits;
-        this.passwordEnabled = passwordEnabled;
-        this.requiresHvm = requiresHvm;
-        this.url = url;
-        this.isPublic = isPublic;
-        this.featured = featured;
-        this.isExtractable = isExtractable;
-        this.format = format;
-        this.guestOsId = guestOsId;
-        this.zoneId = zoneId;
-        this.hypervisorType = hypervisorType;
-        this.accountName = accountName;
-        this.domainId = domainId;
-        this.accountId = accountId;
-        this.chksum = chksum;
-        this.bootable = bootable;
-        this.details = details;
-        this.sshKeyEnbaled = sshKeyEnabled;
-    }
-
-    public TemplateProfile(Long userId, VirtualMachineTemplate template, Long zoneId) {
-        this.userId = userId;
-        this.template = template;
-        this.zoneId = zoneId;
-    }
-
-    public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits,
-            Boolean passwordEnabled, Boolean requiresHvm, String url, Boolean isPublic, Boolean featured,
-            Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId, HypervisorType hypervisorType,
-            String accountName, Long domainId, Long accountId, String chksum, Boolean bootable, String templateTag,
-            Map details, Boolean sshKeyEnabled) {
-        this(templateId, userId, name, displayText, bits, passwordEnabled, requiresHvm, url, isPublic, featured,
-                isExtractable, format, guestOsId, zoneId, hypervisorType, accountName, domainId, accountId, chksum,
-                bootable, details, sshKeyEnabled);
-        this.templateTag = templateTag;
-    }
-
-    public Long getTemplateId() {
-        return templateId;
-    }
-
-    public void setTemplateId(Long id) {
-        this.templateId = id;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public void setDisplayText(String text) {
-        this.displayText = text;
-    }
-
-    public Integer getBits() {
-        return bits;
-    }
-
-    public void setBits(Integer bits) {
-        this.bits = bits;
-    }
-
-    public Boolean getPasswordEnabled() {
-        return passwordEnabled;
-    }
-
-    public void setPasswordEnabled(Boolean enabled) {
-        this.passwordEnabled = enabled;
-    }
-
-    public Boolean getRequiresHVM() {
-        return requiresHvm;
-    }
-
-    public void setRequiresHVM(Boolean hvm) {
-        this.requiresHvm = hvm;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public Boolean getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Boolean is) {
-        this.isPublic = is;
-    }
-
-    public Boolean getFeatured() {
-        return featured;
-    }
-
-    public void setFeatured(Boolean featured) {
-        this.featured = featured;
-    }
-
-    public Boolean getIsExtractable() {
-        return isExtractable;
-    }
-
-    public void setIsExtractable(Boolean is) {
-        this.isExtractable = is;
-    }
-
-    public ImageFormat getFormat() {
-        return format;
-    }
-
-    public void setFormat(ImageFormat format) {
-        this.format = format;
-    }
-
-    public Long getGuestOsId() {
-        return guestOsId;
-    }
-
-    public void setGuestOsId(Long id) {
-        this.guestOsId = id;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public void setZoneId(Long id) {
-        this.zoneId = id;
-    }
-
-    public HypervisorType getHypervisorType() {
-        return hypervisorType;
-    }
-
-    public void setHypervisorType(HypervisorType type) {
-        this.hypervisorType = type;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(Long id) {
-        this.domainId = id;
-    }
-
-    public Long getAccountId() {
-        return accountId;
-    }
-
-    public void setAccountId(Long id) {
-        this.accountId = id;
-    }
-
-    public String getCheckSum() {
-        return chksum;
-    }
-
-    public void setCheckSum(String chksum) {
-        this.chksum = chksum;
-    }
-
-    public Boolean getBootable() {
-        return this.bootable;
-    }
-
-    public void setBootable(Boolean bootable) {
-        this.bootable = bootable;
-    }
-
-    public VirtualMachineTemplate getTemplate() {
-        return template;
-    }
-
-    public void setTemplate(VirtualMachineTemplate template) {
-        this.template = template;
-    }
-
-    public String getTemplateTag() {
-        return templateTag;
-    }
-
-    public void setTemplateTag(String templateTag) {
-        this.templateTag = templateTag;
-    }
-
-    public Map getDetails() {
-        return this.details;
-    }
-
-    public void setDetails(Map details) {
-        this.details = details;
-    }
-
-    public void setSshKeyEnabled(Boolean enabled) {
-        this.sshKeyEnbaled = enabled;
-    }
-
-    public Boolean getSshKeyEnabled() {
-        return this.sshKeyEnbaled;
-    }
-
-    public String getImageStorageUri() {
-        return null;
-    }
-
-    public void setLocalPath(String path) {
-
-    }
-
-    public String getLocalPath() {
-        return null;
-    }
-
-    public String getJobId() {
-        return null;
-    }
-
-    public void setTemplatePoolRefId(long id) {
-
-    }
-
-    public long getId() {
-        return 0;
-    }
-
-    public long getTemplatePoolRefId() {
-        return 0;
-    }
-
-    public long getSize() {
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java
index 52e18f1..085fbbd 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java
@@ -27,7 +27,7 @@ import com.cloud.storage.StoragePool;
 
 public interface TemplateService {
 
-    public class TemplateApiResult extends CommandResult {
+    class TemplateApiResult extends CommandResult {
         private final TemplateInfo template;
 
         public TemplateApiResult(TemplateInfo template) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java
index 463c0ff..3d7b1aa 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java
@@ -23,21 +23,21 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.Volume;
 
 public interface VolumeInfo extends DataObject, Volume {
-    public boolean isAttachedVM();
+    boolean isAttachedVM();
 
-    public void addPayload(Object data);
+    void addPayload(Object data);
 
-    public Object getpayload();
+    Object getpayload();
 
-    public HypervisorType getHypervisorType();
+    HypervisorType getHypervisorType();
 
-    public Long getLastPoolId();
+    Long getLastPoolId();
 
-    public String getAttachedVmName();
+    String getAttachedVmName();
 
-    public void processEventOnly(ObjectInDataStoreStateMachine.Event event);
+    void processEventOnly(ObjectInDataStoreStateMachine.Event event);
 
-    public void processEventOnly(ObjectInDataStoreStateMachine.Event event, Answer answer);
+    void processEventOnly(ObjectInDataStoreStateMachine.Event event, Answer answer);
 
-    public boolean stateTransit(Volume.Event event);
+    boolean stateTransit(Volume.Event event);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeProfile.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeProfile.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeProfile.java
deleted file mode 100644
index 8701912..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeProfile.java
+++ /dev/null
@@ -1,35 +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 org.apache.cloudstack.engine.subsystem.api.storage;
-
-public class VolumeProfile {
-    private String _uri;
-
-    public String getURI() {
-        return _uri;
-    }
-
-    public String getPath() {
-        return null;
-    }
-
-    public long getSize() {
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
index 3947952..f96ea40 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
@@ -29,8 +29,7 @@ import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.host.Host;
 
 public interface VolumeService {
-
-    public class VolumeApiResult extends CommandResult {
+    class VolumeApiResult extends CommandResult {
         private final VolumeInfo volume;
 
         public VolumeApiResult(VolumeInfo volume) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ZoneScope.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ZoneScope.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ZoneScope.java
index 9ba1d10..a0d75b5 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ZoneScope.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ZoneScope.java
@@ -25,6 +25,7 @@ public class ZoneScope extends AbstractScope {
     private Long zoneId;
 
     public ZoneScope(Long zoneId) {
+        super();
         this.zoneId = zoneId;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
index a282a51..121a7ee 100644
--- a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
+++ b/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
@@ -35,7 +35,6 @@ public final class CreateObjectCommand extends Command implements StorageSubSyst
 
     @Override
     public boolean executeInSequence() {
-        // TODO Auto-generated method stub
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
index 8d63a82..70e9bb3 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
@@ -25,13 +25,13 @@ import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
 import com.cloud.utils.db.GenericDao;
 
 public interface ImageStoreDao extends GenericDao<ImageStoreVO, Long> {
-    public ImageStoreVO findByName(String name);
+    ImageStoreVO findByName(String name);
 
-    public List<ImageStoreVO> findByProvider(String provider);
+    List<ImageStoreVO> findByProvider(String provider);
 
-    public List<ImageStoreVO> findByScope(ZoneScope scope);
+    List<ImageStoreVO> findByScope(ZoneScope scope);
 
-    public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
+    List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
 
-    public List<ImageStoreVO> listImageStores();
+    List<ImageStoreVO> listImageStores();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
index 3c903ad..5ed48a3 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
@@ -80,6 +80,9 @@ public class ImageStoreVO implements ImageStore {
     @Column(name = "total_size")
     private Long totalSize;
 
+    @Column(name = "used_bytes")
+    private Long usedBytes;
+
     public DataStoreRole getRole() {
         return role;
     }
@@ -180,4 +183,11 @@ public class ImageStoreVO implements ImageStore {
         this.totalSize = totalSize;
     }
 
+    public Long getUsedBytes() {
+        return usedBytes;
+    }
+
+    public void setUsedBytes(Long usedBytes) {
+        this.usedBytes = usedBytes;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index 0808287..8f7826f 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -147,7 +147,7 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO, Long>
     @Override
     public void updateAvailable(long id, long available) {
         StoragePoolVO pool = createForUpdate(id);
-        pool.setAvailableBytes(available);
+        pool.setUsedBytes(available);
         update(id, pool);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
index 48d0db2..01f0220 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
@@ -28,13 +28,13 @@ import com.cloud.utils.fsm.StateDao;
 public interface SnapshotDataStoreDao extends GenericDao<SnapshotDataStoreVO, Long>,
         StateDao<ObjectInDataStoreStateMachine.State, ObjectInDataStoreStateMachine.Event, DataObjectInStore> {
 
-    public List<SnapshotDataStoreVO> listByStoreId(long id, DataStoreRole role);
+    List<SnapshotDataStoreVO> listByStoreId(long id, DataStoreRole role);
 
-    public void deletePrimaryRecordsForStore(long id);
+    void deletePrimaryRecordsForStore(long id);
 
-    public SnapshotDataStoreVO findByStoreSnapshot(DataStoreRole role, long storeId, long snapshotId);
+    SnapshotDataStoreVO findByStoreSnapshot(DataStoreRole role, long storeId, long snapshotId);
 
-    public SnapshotDataStoreVO findBySnapshot(long snapshotId, DataStoreRole role);
+    SnapshotDataStoreVO findBySnapshot(long snapshotId, DataStoreRole role);
 
-    public List<SnapshotDataStoreVO> listDestroyed(long storeId);
+    List<SnapshotDataStoreVO> listDestroyed(long storeId);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
index 6ceb0d0..2ae3e8c 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
@@ -92,6 +92,9 @@ public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMa
     @Enumerated(EnumType.STRING)
     ObjectInDataStoreStateMachine.State state;
 
+    @Column(name = "ref_cnt")
+    Long refCnt;
+
     public String getInstallPath() {
         return installPath;
     }
@@ -242,4 +245,16 @@ public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMa
     public void setParentSnapshotId(long parentSnapshotId) {
         this.parentSnapshotId = parentSnapshotId;
     }
+
+    public Long getRefCnt() {
+        return refCnt;
+    }
+
+    public void incrRefCnt() {
+        this.refCnt++;
+    }
+
+    public void decrRefCnt() {
+        this.refCnt--;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
index a991924..9b8de67 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
@@ -71,8 +71,8 @@ public class StoragePoolVO implements StoragePool {
     @Column(name = "pod_id", updatable = true)
     private Long podId;
 
-    @Column(name = "available_bytes", updatable = true, nullable = true)
-    private long availableBytes;
+    @Column(name = "used_bytes", updatable = true, nullable = true)
+    private long usedBytes;
 
     @Column(name = "capacity_bytes", updatable = true, nullable = true)
     private long capacityBytes;
@@ -126,7 +126,7 @@ public class StoragePoolVO implements StoragePool {
         this.uuid = uuid;
         this.poolType = type;
         this.dataCenterId = dataCenterId;
-        this.availableBytes = availableBytes;
+        this.usedBytes = availableBytes;
         this.capacityBytes = capacityBytes;
         this.hostAddress = hostAddress;
         this.path = hostPath;
@@ -136,7 +136,7 @@ public class StoragePoolVO implements StoragePool {
     }
 
     public StoragePoolVO(StoragePoolVO that) {
-        this(that.id, that.name, that.uuid, that.poolType, that.dataCenterId, that.podId, that.availableBytes,
+        this(that.id, that.name, that.uuid, that.poolType, that.dataCenterId, that.podId, that.usedBytes,
                 that.capacityBytes, that.hostAddress, that.port, that.path);
     }
 
@@ -181,8 +181,8 @@ public class StoragePoolVO implements StoragePool {
         return dataCenterId;
     }
 
-    public long getAvailableBytes() {
-        return availableBytes;
+    public long getUsedBytes() {
+        return usedBytes;
     }
 
     public String getStorageProviderName() {
@@ -197,8 +197,8 @@ public class StoragePoolVO implements StoragePool {
         return capacityBytes;
     }
 
-    public void setAvailableBytes(long available) {
-        availableBytes = available;
+    public void setUsedBytes(long available) {
+        usedBytes = available;
     }
 
     public void setCapacityBytes(long capacity) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
index 79acd31..13b84ff 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
@@ -30,13 +30,13 @@ import com.cloud.utils.fsm.StateDao;
 public interface TemplateDataStoreDao extends GenericDao<TemplateDataStoreVO, Long>,
         StateDao<ObjectInDataStoreStateMachine.State, ObjectInDataStoreStateMachine.Event, DataObjectInStore> {
 
-    public List<TemplateDataStoreVO> listByStoreId(long id);
+    List<TemplateDataStoreVO> listByStoreId(long id);
 
-    public List<TemplateDataStoreVO> listDestroyed(long storeId);
+    List<TemplateDataStoreVO> listDestroyed(long storeId);
 
-    public void deletePrimaryRecordsForStore(long id);
+    void deletePrimaryRecordsForStore(long id);
 
-    public void deletePrimaryRecordsForTemplate(long templateId);
+    void deletePrimaryRecordsForTemplate(long templateId);
 
     List<TemplateDataStoreVO> listByTemplateStore(long templateId, long storeId);
 


Mime
View raw message