cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [29/50] [abbrv] clean up storage related code, and add lru replacement algorithm for cache storage
Date Thu, 20 Jun 2013 07:20:02 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
deleted file mode 100644
index 43ec609..0000000
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
+++ /dev/null
@@ -1,296 +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.storage.snapshot.db;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Snapshot.State;
-import com.cloud.storage.Snapshot.Type;
-import com.cloud.utils.db.GenericDao;
-import com.google.gson.annotations.Expose;
-
-@Entity
-@Table(name = "snapshots")
-public class SnapshotVO {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private final long id = -1;
-
-    @Column(name = "data_center_id")
-    long dataCenterId;
-
-    @Column(name = "account_id")
-    long accountId;
-
-    @Column(name = "domain_id")
-    long domainId;
-
-    @Column(name = "volume_id")
-    Long volumeId;
-
-    @Column(name = "disk_offering_id")
-    Long diskOfferingId;
-
-    @Expose
-    @Column(name = "path")
-    String path;
-
-    @Expose
-    @Column(name = "name")
-    String name;
-
-    @Expose
-    @Column(name = "status", updatable = true, nullable = false)
-    @Enumerated(value = EnumType.STRING)
-    private State status;
-
-    @Column(name = "snapshot_type")
-    short snapshotType;
-
-    @Column(name = "type_description")
-    String typeDescription;
-
-    @Column(name = "size")
-    long size;
-
-    @Column(name = GenericDao.CREATED_COLUMN)
-    Date created;
-
-    @Column(name = GenericDao.REMOVED_COLUMN)
-    Date removed;
-
-    @Column(name = "backup_snap_id")
-    String backupSnapshotId;
-
-    @Column(name = "swift_id")
-    Long swiftId;
-
-    @Column(name = "s3_id")
-    Long s3Id;
-
-    @Column(name = "sechost_id")
-    Long secHostId;
-
-    @Column(name = "prev_snap_id")
-    long prevSnapshotId;
-
-    @Column(name = "hypervisor_type")
-    @Enumerated(value = EnumType.STRING)
-    HypervisorType hypervisorType;
-
-    @Expose
-    @Column(name = "version")
-    String version;
-
-    @Column(name = "uuid")
-    String uuid;
-
-    public SnapshotVO() {
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path,
-            String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType) {
-        this.dataCenterId = dcId;
-        this.accountId = accountId;
-        this.domainId = domainId;
-        this.volumeId = volumeId;
-        this.diskOfferingId = diskOfferingId;
-        this.path = path;
-        this.name = name;
-        this.snapshotType = snapshotType;
-        this.typeDescription = typeDescription;
-        this.size = size;
-        this.status = State.Creating;
-        this.prevSnapshotId = 0;
-        this.hypervisorType = hypervisorType;
-        this.version = "2.2";
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public long getAccountId() {
-        return accountId;
-    }
-
-    public long getDomainId() {
-        return domainId;
-    }
-
-    public long getVolumeId() {
-        return volumeId;
-    }
-
-    public long getDiskOfferingId() {
-        return diskOfferingId;
-    }
-
-    public void setVolumeId(Long volumeId) {
-        this.volumeId = volumeId;
-    }
-
-    public String getPath() {
-        return path;
-    }
-
-    public void setPath(String path) {
-        this.path = path;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public short getsnapshotType() {
-        return snapshotType;
-    }
-
-    public Type getType() {
-        if (snapshotType < 0 || snapshotType >= Type.values().length) {
-            return null;
-        }
-        return Type.values()[snapshotType];
-    }
-
-    public Long getSwiftId() {
-        return swiftId;
-    }
-
-    public void setSwiftId(Long swiftId) {
-        this.swiftId = swiftId;
-    }
-
-    public Long getSecHostId() {
-        return secHostId;
-    }
-
-    public void setSecHostId(Long secHostId) {
-        this.secHostId = secHostId;
-    }
-
-    public HypervisorType getHypervisorType() {
-        return hypervisorType;
-    }
-
-    public void setSnapshotType(short snapshotType) {
-        this.snapshotType = snapshotType;
-    }
-
-    public boolean isRecursive() {
-        if (snapshotType >= Type.HOURLY.ordinal() && snapshotType <= Type.MONTHLY.ordinal()) {
-            return true;
-        }
-        return false;
-    }
-
-    public long getSize() {
-        return size;
-    }
-
-    public String getTypeDescription() {
-        return typeDescription;
-    }
-
-    public void setTypeDescription(String typeDescription) {
-        this.typeDescription = typeDescription;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public State getStatus() {
-        return status;
-    }
-
-    public void setStatus(State status) {
-        this.status = status;
-    }
-
-    public String getBackupSnapshotId() {
-        return backupSnapshotId;
-    }
-
-    public long getPrevSnapshotId() {
-        return prevSnapshotId;
-    }
-
-    public void setBackupSnapshotId(String backUpSnapshotId) {
-        this.backupSnapshotId = backUpSnapshotId;
-    }
-
-    public void setPrevSnapshotId(long prevSnapshotId) {
-        this.prevSnapshotId = prevSnapshotId;
-    }
-
-    public static Type getSnapshotType(String snapshotType) {
-        for (Type type : Type.values()) {
-            if (type.equals(snapshotType)) {
-                return type;
-            }
-        }
-        return null;
-    }
-
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public Long getS3Id() {
-        return s3Id;
-    }
-
-    public void setS3Id(Long s3Id) {
-        this.s3Id = s3Id;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
index 7120da1..b92f92f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
@@ -55,11 +55,6 @@ public class DataStoreManagerImpl implements DataStoreManager {
     }
 
     @Override
-    public DataStore registerDataStore(Map<String, String> params, String providerUuid) {
-        return null;
-    }
-
-    @Override
     public DataStore getDataStore(String uuid, DataStoreRole role) {
         if (role == DataStoreRole.Primary) {
             return primaryStorMgr.getPrimaryDataStore(uuid);
@@ -85,11 +80,6 @@ public class DataStoreManagerImpl implements DataStoreManager {
     }
 
     @Override
-    public List<DataStore> getImageStoresByProvider(String provider) {
-        return imageDataStoreMgr.listImageStoreByProvider(provider);
-    }
-
-    @Override
     public DataStore getPrimaryDataStore(long storeId) {
         return primaryStorMgr.getPrimaryDataStore(storeId);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreEntityImpl.java
index f62adfc..e861910 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreEntityImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreEntityImpl.java
@@ -170,7 +170,7 @@ public class PrimaryDataStoreEntityImpl implements StorageEntity {
     }
 
     @Override
-    public long getAvailableBytes() {
+    public long getUsedBytes() {
         // TODO Auto-generated method stub
         return 0;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
index db056e9..50238a8 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
@@ -57,12 +57,6 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
         return providerMap.get(name);
     }
 
-    @Override
-    public List<DataStoreProvider> getDataStoreProviders() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
     public List<StorageProviderResponse> getPrimaryDataStoreProviders() {
         List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
         for (DataStoreProvider provider : providerMap.values()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
index 561c8c4..93b0c2b 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
@@ -67,29 +67,10 @@ public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver {
     EndPointSelector _epSelector;
 
     @Override
-    public String grantAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }
 
-
-    @Override
-    public boolean revokeAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public Set<DataObject> listObjects(DataStore store) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
     class CreateContext<T> extends AsyncRpcConext<T> {
         final DataObject data;
 
@@ -202,8 +183,6 @@ public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver {
         return null;
     }
 
-
-
     @Override
     public void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback) {
         DeleteCommand cmd = new DeleteCommand(data.getTO());
@@ -224,21 +203,14 @@ public abstract class BaseImageStoreDriverImpl implements ImageStoreDriver {
 
     @Override
     public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public boolean canCopy(DataObject srcData, DataObject destData) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
-
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
index 70e5a5a..6815dec 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
@@ -108,12 +108,12 @@ public class PrimaryDataStoreHelper {
 
         StoragePoolVO pool = this.dataStoreDao.findById(store.getId());
         pool.setScope(scope.getScopeType());
-        pool.setAvailableBytes(existingInfo.getAvailableBytes());
+        pool.setUsedBytes(existingInfo.getAvailableBytes());
         pool.setCapacityBytes(existingInfo.getCapacityBytes());
         pool.setStatus(StoragePoolStatus.Up);
         this.dataStoreDao.update(pool.getId(), pool);
         this.storageMgr.createCapacityEntry(pool, Capacity.CAPACITY_TYPE_LOCAL_STORAGE,
-                pool.getCapacityBytes() - pool.getAvailableBytes());
+                pool.getUsedBytes());
         return dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
index 1fc8251..cfdb5c0 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreImpl.java
@@ -168,19 +168,16 @@ public class PrimaryDataStoreImpl implements PrimaryDataStore {
 
     @Override
     public boolean isHypervisorSupported(HypervisorType hypervisor) {
-        // TODO Auto-generated method stub
         return true;
     }
 
     @Override
     public boolean isLocalStorageSupported() {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean isVolumeDiskTypeSupported(DiskFormat diskType) {
-        // TODO Auto-generated method stub
         return false;
     }
 
@@ -216,13 +213,11 @@ public class PrimaryDataStoreImpl implements PrimaryDataStore {
 
     @Override
     public SnapshotInfo getSnapshot(long snapshotId) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public DiskFormat getDefaultDiskType() {
-        // TODO Auto-generated method stub
         return null;
     }
 
@@ -288,8 +283,8 @@ public class PrimaryDataStoreImpl implements PrimaryDataStore {
     }
 
     @Override
-    public long getAvailableBytes() {
-        return this.pdsv.getAvailableBytes();
+    public long getUsedBytes() {
+        return this.pdsv.getUsedBytes();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
deleted file mode 100644
index b248758..0000000
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
+++ /dev/null
@@ -1,16 +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.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
index 6431308..fa5e216 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
@@ -81,7 +81,7 @@ public class DefaultHostListener implements HypervisorHostListener {
         }
 
         StoragePoolVO poolVO = this.primaryStoreDao.findById(poolId);
-        poolVO.setAvailableBytes(mspAnswer.getPoolInfo().getAvailableBytes());
+        poolVO.setUsedBytes(mspAnswer.getPoolInfo().getAvailableBytes());
         poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
         primaryStoreDao.update(pool.getId(), poolVO);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeEntityImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeEntityImpl.java
deleted file mode 100644
index 454a50c..0000000
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeEntityImpl.java
+++ /dev/null
@@ -1,201 +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.storage.volume;
-
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
-import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
-import org.apache.cloudstack.engine.datacenter.entity.api.StorageEntity;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
-import org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeType;
-import org.apache.cloudstack.storage.datastore.PrimaryDataStoreEntityImpl;
-
-public class VolumeEntityImpl implements VolumeEntity {
-    private VolumeInfo volumeInfo;
-    private final VolumeService vs;
-    private VolumeApiResult result;
-
-    public VolumeEntityImpl() {
-        this.vs = null;
-    }
-
-    public VolumeEntityImpl(VolumeInfo volumeObject, VolumeService vs) {
-        this.volumeInfo = volumeObject;
-        this.vs = vs;
-    }
-
-    public VolumeInfo getVolumeInfo() {
-        return volumeInfo;
-    }
-
-    @Override
-    public String getUuid() {
-        return volumeInfo.getUuid();
-    }
-
-    @Override
-    public long getId() {
-        return volumeInfo.getId();
-    }
-
-    public String getExternalId() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public String getCurrentState() {
-        return null;
-    }
-
-    @Override
-    public String getDesiredState() {
-        return null;
-    }
-
-    @Override
-    public Date getCreatedTime() {
-        return null;
-    }
-
-    @Override
-    public Date getLastUpdatedTime() {
-        return null;
-    }
-
-    @Override
-    public String getOwner() {
-        return null;
-    }
-
-    @Override
-    public List<Method> getApplicableActions() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public SnapshotEntity takeSnapshotOf(boolean full) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public String reserveForMigration(long expirationTime) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public void migrate(String reservationToken) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public VolumeEntity setupForCopy() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public void copy(VolumeEntity dest) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void attachTo(String vm, long deviceId) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void detachFrom() {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public long getSize() {
-        return volumeInfo.getSize();
-    }
-
-    @Override
-    public DiskFormat getDiskType() {
-        return null;
-    }
-
-    @Override
-    public VolumeType getType() {
-        return null;
-    }
-
-    @Override
-    public StorageEntity getDataStore() {
-        return new PrimaryDataStoreEntityImpl((PrimaryDataStoreInfo) volumeInfo.getDataStore());
-    }
-
-    @Override
-    public void destroy() {
-        /*
-         * AsyncCallFuture<VolumeApiResult> future =
-         * vs.deleteVolumeAsync(volumeInfo); try { result = future.get(); if
-         * (!result.isSuccess()) { throw new
-         * CloudRuntimeException("Failed to create volume:" +
-         * result.getResult()); } } catch (InterruptedException e) { throw new
-         * CloudRuntimeException("wait to delete volume info failed", e); }
-         * catch (ExecutionException e) { throw new
-         * CloudRuntimeException("wait to delete volume failed", e); }
-         */
-    }
-
-    @Override
-    public Map<String, String> getDetails() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public void addDetail(String name, String value) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void delDetail(String name, String value) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public void updateDetail(String name, String value) {
-        // TODO Auto-generated method stub
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index 963015c..e799098 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -451,6 +451,47 @@ public class VolumeObject implements VolumeInfo {
 
     }
 
+    public void incRefCount() {
+        if (this.dataStore == null) {
+            return;
+        }
+
+        if (this.dataStore.getRole() == DataStoreRole.Image ||
+                this.dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findById(this.dataStore.getId());
+            store.incrRefCnt();
+            store.setLastUpdated(new Date());
+            volumeStoreDao.update(store.getId(), store);
+        }
+    }
+
+    @Override
+    public void decRefCount() {
+        if (this.dataStore == null) {
+            return;
+        }
+        if (this.dataStore.getRole() == DataStoreRole.Image ||
+                this.dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findById(this.dataStore.getId());
+            store.decrRefCnt();
+            store.setLastUpdated(new Date());
+            volumeStoreDao.update(store.getId(), store);
+        }
+    }
+
+    @Override
+    public Long getRefCount() {
+        if (this.dataStore == null) {
+            return null;
+        }
+        if (this.dataStore.getRole() == DataStoreRole.Image ||
+                this.dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findById(this.dataStore.getId());
+            return store.getRefCnt();
+        }
+        return null;
+    }
+
     @Override
     public void processEventOnly(ObjectInDataStoreStateMachine.Event event, Answer answer) {
         try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 7d5b7a2..1d36f93 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -120,9 +120,6 @@ public class VolumeServiceImpl implements VolumeService {
         private final DataObject volume;
         private final AsyncCallFuture<VolumeApiResult> future;
 
-        /**
-         * @param callback
-         */
         public CreateVolumeContext(AsyncCompletionCallback<T> callback, DataObject volume,
                 AsyncCallFuture<VolumeApiResult> future) {
             super(callback);
@@ -178,9 +175,6 @@ public class VolumeServiceImpl implements VolumeService {
         private final VolumeObject volume;
         private final AsyncCallFuture<VolumeApiResult> future;
 
-        /**
-         * @param callback
-         */
         public DeleteVolumeContext(AsyncCompletionCallback<T> callback, VolumeObject volume,
                 AsyncCallFuture<VolumeApiResult> future) {
             super(callback);
@@ -266,17 +260,7 @@ public class VolumeServiceImpl implements VolumeService {
 
     @Override
     public VolumeEntity getVolumeEntity(long volumeId) {
-        VolumeVO vo = volDao.findById(volumeId);
-        if (vo == null) {
-            return null;
-        }
-
-        if (vo.getPoolId() == null) {
-            return new VolumeEntityImpl(VolumeObject.getVolumeObject(null, vo), this);
-        } else {
-            PrimaryDataStore dataStore = dataStoreMgr.getPrimaryDataStore(vo.getPoolId());
-            return new VolumeEntityImpl(dataStore.getVolume(volumeId), this);
-        }
+        return null;
     }
 
     class CreateBaseImageContext<T> extends AsyncRpcConext<T> {
@@ -315,15 +299,6 @@ public class VolumeServiceImpl implements VolumeService {
 
     }
 
-    static class CreateBaseImageResult extends CommandResult {
-        final TemplateInfo template;
-
-        public CreateBaseImageResult(TemplateInfo template) {
-            super();
-            this.template = template;
-        }
-    }
-
     private TemplateInfo waitForTemplateDownloaded(PrimaryDataStore store, TemplateInfo template) {
         int storagePoolMaxWaitSeconds = NumbersUtil.parseInt(
                 configDao.getValue(Config.StoragePoolMaxWaitSeconds.key()), 3600);
@@ -571,9 +546,6 @@ public class VolumeServiceImpl implements VolumeService {
         final VolumeInfo destVolume;
         final AsyncCallFuture<VolumeApiResult> future;
 
-        /**
-         * @param callback
-         */
         public CopyVolumeContext(AsyncCompletionCallback<T> callback, AsyncCallFuture<VolumeApiResult> future,
                 VolumeInfo srcVolume, VolumeInfo destVolume, DataStore destStore) {
             super(callback);
@@ -845,9 +817,6 @@ public class VolumeServiceImpl implements VolumeService {
         final Map<VolumeInfo, DataStore> volumeToPool;
         final AsyncCallFuture<CommandResult> future;
 
-        /**
-         * @param callback
-         */
         public MigrateVmWithVolumesContext(AsyncCompletionCallback<T> callback, AsyncCallFuture<CommandResult> future,
                 Map<VolumeInfo, DataStore> volumeToPool) {
             super(callback);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
index 7ff56f6..7b30575 100644
--- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
@@ -124,50 +124,32 @@ public class CloudStackImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
     @Override
     public boolean attachCluster(DataStore store, ClusterScope scope) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        // TODO Auto-generated method stub
         return false;
     }
 
 
     @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean maintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean cancelMaintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean deleteDataStore(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
index 6965a15..2630d13 100644
--- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
@@ -53,8 +53,6 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
     ImageStoreHelper imageStoreHelper;
     @Inject
     ImageStoreProviderManager imageStoreMgr;
-    @Inject
-    S3Manager _s3Mgr;
 
     protected List<? extends Discoverer> _discoverers;
 
@@ -83,12 +81,6 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
         s_logger.info("Trying to add a S3 store in data center " + dcId);
 
-        /*
-         * try{ // verify S3 parameters _s3Mgr.verifyS3Fields(details); } catch
-         * (DiscoveryException ex){ throw new
-         * InvalidParameterValueException("failed to verify S3 parameters!"); }
-         */
-
         Map<String, Object> imageStoreParameters = new HashMap<String, Object>();
         imageStoreParameters.put("name", name);
         imageStoreParameters.put("zoneId", dcId);
@@ -113,51 +105,31 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
     @Override
     public boolean attachCluster(DataStore store, ClusterScope scope) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        // TODO Auto-generated method stub
         return false;
     }
 
-
-
     @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean maintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean cancelMaintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean deleteDataStore(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/driver/SampleImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/driver/SampleImageStoreDriverImpl.java b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/driver/SampleImageStoreDriverImpl.java
index 2dae3c8..44f94f3 100644
--- a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/driver/SampleImageStoreDriverImpl.java
+++ b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/driver/SampleImageStoreDriverImpl.java
@@ -37,15 +37,12 @@ public class SampleImageStoreDriverImpl extends BaseImageStoreDriverImpl {
     public SampleImageStoreDriverImpl() {
     }
 
-
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-
     @Override
     public String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format) {
         // TODO Auto-generated method stub

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SampleImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SampleImageStoreLifeCycleImpl.java b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SampleImageStoreLifeCycleImpl.java
index c7e4801..e4df6f5 100644
--- a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SampleImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SampleImageStoreLifeCycleImpl.java
@@ -52,49 +52,31 @@ public class SampleImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
     @Override
     public boolean attachCluster(DataStore store, ClusterScope scope) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisor) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean maintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean cancelMaintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean deleteDataStore(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
index c0c55d6..c52e96e 100644
--- a/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
+++ b/plugins/storage/image/sample/src/org/apache/cloudstack/storage/datastore/provider/SampleImageStoreProviderImpl.java
@@ -44,8 +44,6 @@ public class SampleImageStoreProviderImpl implements ImageStoreProvider {
     protected ImageStoreDriver driver;
     @Inject
     ImageStoreProviderManager storeMgr;
-    long id;
-    String uuid;
 
     @Override
     public DataStoreLifeCycle getDataStoreLifeCycle() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
index bd5a14a..d6d6cd2 100644
--- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
+++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java
@@ -39,7 +39,6 @@ public class SwiftImageStoreDriverImpl extends BaseImageStoreDriverImpl {
     @Inject
     ImageStoreDetailsDao _imageStoreDetailsDao;
 
-
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
         ImageStoreImpl imgStore = (ImageStoreImpl) store;
@@ -48,11 +47,9 @@ public class SwiftImageStoreDriverImpl extends BaseImageStoreDriverImpl {
                 details.get(ApiConstants.USERNAME), details.get(ApiConstants.KEY));
     }
 
-
     @Override
     public String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format) {
         throw new UnsupportedServiceException("Extract entity url is not yet supported for Swift image store provider");
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
index 38e2007..4256cc2 100644
--- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
@@ -16,12 +16,11 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.lifecycle;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Inject;
-
+import com.cloud.agent.api.StoragePoolInfo;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.resource.ResourceManager;
+import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.ScopeType;
 import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
@@ -33,12 +32,9 @@ import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
 import org.apache.cloudstack.storage.image.store.lifecycle.ImageStoreLifeCycle;
 import org.apache.log4j.Logger;
 
-import com.cloud.agent.api.StoragePoolInfo;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.resource.Discoverer;
-import com.cloud.resource.ResourceManager;
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.ScopeType;
+import javax.inject.Inject;
+import java.util.HashMap;
+import java.util.Map;
 
 public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
@@ -52,16 +48,6 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
     @Inject
     ImageStoreProviderManager imageStoreMgr;
 
-    protected List<? extends Discoverer> _discoverers;
-
-    public List<? extends Discoverer> getDiscoverers() {
-        return _discoverers;
-    }
-
-    public void setDiscoverers(List<? extends Discoverer> _discoverers) {
-        this._discoverers = _discoverers;
-    }
-
     public SwiftImageStoreLifeCycleImpl() {
     }
 
@@ -99,50 +85,32 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
     @Override
     public boolean attachCluster(DataStore store, ClusterScope scope) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        // TODO Auto-generated method stub
         return false;
     }
 
 
     @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean maintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean cancelMaintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean deleteDataStore(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
index 4c2f389..8d7c965 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
@@ -18,27 +18,6 @@
  */
 package org.apache.cloudstack.storage.datastore.driver;
 
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.storage.command.CommandResult;
-import org.apache.cloudstack.storage.command.CreateObjectCommand;
-import org.apache.cloudstack.storage.command.DeleteCommand;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.cloudstack.storage.volume.VolumeObject;
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.storage.ResizeVolumeAnswer;
 import com.cloud.agent.api.storage.ResizeVolumeCommand;
@@ -58,6 +37,16 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.storage.snapshot.SnapshotManager;
 import com.cloud.vm.dao.VMInstanceDao;
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.storage.command.CommandResult;
+import org.apache.cloudstack.storage.command.CreateObjectCommand;
+import org.apache.cloudstack.storage.command.DeleteCommand;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.volume.VolumeObject;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
 
 public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
     private static final Logger s_logger = Logger.getLogger(CloudStackPrimaryDataStoreDriverImpl.class);
@@ -85,31 +74,12 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
     EndPointSelector epSelector;
 
     @Override
-    public String grantAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }
 
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean revokeAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public Set<DataObject> listObjects(DataStore store) {
-        // TODO Auto-generated method stub
         return null;
     }
 
@@ -126,7 +96,6 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
 
     @Override
     public void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
         String errMsg = null;
         Answer answer = null;
         if (data.getType() == DataObjectType.VOLUME) {
@@ -168,13 +137,10 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
 
     @Override
     public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public boolean canCopy(DataObject srcData, DataObject destData) {
-        // TODO Auto-generated method stub
         return false;
     }
 
@@ -205,8 +171,6 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
 
     @Override
     public void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
index 38dd5a9..2e0ff66 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
@@ -418,18 +418,6 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
     }
 
     @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
     public boolean maintain(DataStore dataStore) {
         storagePoolAutmation.maintain(dataStore);
         this.dataStoreHelper.maintain(dataStore);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
index ad506d1..643c933 100644
--- a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java
@@ -16,35 +16,20 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.driver;
 
-import java.net.URISyntaxException;
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.storage.dao.StoragePoolHostDao;
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.framework.async.AsyncRpcConext;
 import org.apache.cloudstack.storage.command.CommandResult;
-import org.apache.cloudstack.storage.command.CreateObjectAnswer;
 import org.apache.cloudstack.storage.command.CreateObjectCommand;
 import org.apache.cloudstack.storage.datastore.DataObjectManager;
 import org.apache.log4j.Logger;
 
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.to.DataStoreTO;
-import com.cloud.agent.api.to.DataTO;
-import com.cloud.storage.dao.StoragePoolHostDao;
-import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.storage.encoding.DecodedDataObject;
-import com.cloud.utils.storage.encoding.Decoder;
+import javax.inject.Inject;
 
 public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
     private static final Logger s_logger = Logger.getLogger(SamplePrimaryDataStoreDriverImpl.class);
@@ -66,25 +51,15 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
 
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     private class CreateVolumeContext<T> extends AsyncRpcConext<T> {
         private final DataObject volume;
-
-        /**
-         * @param callback
-         */
         public CreateVolumeContext(AsyncCompletionCallback<T> callback, DataObject volume) {
             super(callback);
             this.volume = volume;
         }
-
-        public DataObject getVolume() {
-            return this.volume;
-        }
-
     }
 
     public Void createAsyncCallback(AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> callback,
@@ -183,74 +158,24 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
     }
 
     @Override
-    public String grantAccess(DataObject object, EndPoint ep) {
-        // StoragePoolHostVO poolHost =
-        // storeHostDao.findByPoolHost(object.getDataStore().getId(),
-        // ep.getId());
-
-        String uri = object.getUri();
-        try {
-            DecodedDataObject obj = Decoder.decode(uri);
-            if (obj.getPath() == null) {
-                // create an obj
-                EndPoint newEp = selector.select(object);
-                CreateObjectCommand createCmd = new CreateObjectCommand(null);
-                CreateObjectAnswer answer = (CreateObjectAnswer) ep.sendMessage(createCmd);
-                if (answer.getResult()) {
-                    // dataObjMgr.update(object, answer.getPath(),
-                    // answer.getSize());
-                } else {
-                    s_logger.debug("failed to create object" + answer.getDetails());
-                    throw new CloudRuntimeException("failed to create object" + answer.getDetails());
-                }
-            }
-
-            return object.getUri();
-        } catch (URISyntaxException e) {
-            throw new CloudRuntimeException("uri parsed error", e);
-        }
-    }
-
-    @Override
-    public boolean revokeAccess(DataObject vol, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public Set<DataObject> listObjects(DataStore store) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
     public void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public boolean canCopy(DataObject srcData, DataObject destData) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SamplePrimaryDataStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SamplePrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SamplePrimaryDataStoreLifeCycleImpl.java
index 7ee8565..92538ad 100644
--- a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SamplePrimaryDataStoreLifeCycleImpl.java
+++ b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/lifecycle/SamplePrimaryDataStoreLifeCycleImpl.java
@@ -18,18 +18,12 @@
  */
 package org.apache.cloudstack.storage.datastore.lifecycle;
 
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
-import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle;
-import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
+import com.cloud.agent.api.StoragePoolInfo;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.StoragePoolStatus;
+import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.cloudstack.storage.command.AttachPrimaryDataStoreCmd;
 import org.apache.cloudstack.storage.command.CreatePrimaryDataStoreCmd;
 import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager;
@@ -37,11 +31,9 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper;
 
-import com.cloud.agent.api.StoragePoolInfo;
-import com.cloud.host.HostVO;
-import com.cloud.host.dao.HostDao;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.StoragePoolStatus;
+import javax.inject.Inject;
+import java.util.List;
+import java.util.Map;
 
 public class SamplePrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
     @Inject
@@ -103,44 +95,27 @@ public class SamplePrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLife
     }
 
     @Override
-    public boolean dettach() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean maintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean cancelMaintain(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean deleteDataStore(DataStore store) {
-        // TODO Auto-generated method stub
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/provider/SamplePrimaryDatastoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/provider/SamplePrimaryDatastoreProviderImpl.java b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/provider/SamplePrimaryDatastoreProviderImpl.java
index 8708821..79ffc8f 100644
--- a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/provider/SamplePrimaryDatastoreProviderImpl.java
+++ b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/provider/SamplePrimaryDatastoreProviderImpl.java
@@ -40,8 +40,6 @@ public class SamplePrimaryDatastoreProviderImpl implements PrimaryDataStoreProvi
     PrimaryDataStoreProviderManager storeMgr;
 
     protected DataStoreLifeCycle lifecycle;
-    protected String uuid;
-    protected long id;
 
     @Override
     public String getName() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
index a296bab..960378c 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
@@ -16,92 +16,51 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.driver;
 
-import java.util.Set;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-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.engine.subsystem.api.storage.*;
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.storage.command.CommandResult;
 
 public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
 
     @Override
-    public String grantAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
     public DataTO getTO(DataObject data) {
         return null;
     }
 
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean revokeAccess(DataObject data, EndPoint ep) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public Set<DataObject> listObjects(DataStore store) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public boolean canCopy(DataObject srcData, DataObject destData) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CommandResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) {
-        // TODO Auto-generated method stub
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidfirePrimaryDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidfirePrimaryDataStoreProvider.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidfirePrimaryDataStoreProvider.java
index 03f241e..2965e8f 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidfirePrimaryDataStoreProvider.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/provider/SolidfirePrimaryDataStoreProvider.java
@@ -29,11 +29,6 @@ import org.springframework.stereotype.Component;
 public class SolidfirePrimaryDataStoreProvider implements PrimaryDataStoreProvider {
     private final String name = "Solidfire Primary Data Store Provider";
 
-    public SolidfirePrimaryDataStoreProvider() {
-
-        // TODO Auto-generated constructor stub
-    }
-
     @Override
     public String getName() {
         return name;
@@ -41,31 +36,26 @@ public class SolidfirePrimaryDataStoreProvider implements PrimaryDataStoreProvid
 
     @Override
     public DataStoreLifeCycle getDataStoreLifeCycle() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public DataStoreDriver getDataStoreDriver() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public HypervisorHostListener getHostListener() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public boolean configure(Map<String, Object> params) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public Set<DataStoreProviderType> getTypes() {
-        // TODO Auto-generated method stub
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 5ee0fad..6bad417 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -72,7 +72,10 @@ public enum Config {
 	StorageOverprovisioningFactor("Storage", StoragePoolAllocator.class, String.class, "storage.overprovisioning.factor", "2", "Used for storage overprovisioning calculation; available storage will be (actualStorageSize * storage.overprovisioning.factor)", null, ConfigurationParameterScope.zone.toString()),
 	StorageStatsInterval("Storage", ManagementServer.class, String.class, "storage.stats.interval", "60000", "The interval (in milliseconds) when storage stats (per host) are retrieved from agents.", null),
 	MaxVolumeSize("Storage", ManagementServer.class, Integer.class, "storage.max.volume.size", "2000", "The maximum size for a volume (in GB).", null),
-	MaxUploadVolumeSize("Storage",  ManagementServer.class, Integer.class, "storage.max.volume.upload.size", "500", "The maximum size for a uploaded volume(in GB).", null),
+    StorageCacheReplacementLRUTimeInterval("Storage", ManagementServer.class, Integer.class, "storage.cache.replacement.lru.interval", "30", "time interval for unsed data on cache storage (in days).", null),
+    StorageCacheReplacementEnabled("Storage", ManagementServer.class, Boolean.class, "storage.cache.replacement.enabled", "true", "enable or disable cache storage replacement algorithm.", null),
+    StorageCacheReplacementInterval("Storage", ManagementServer.class, Integer.class, "storage.cache.replacement.interval", "86400", "time interval between cache replacement threads (in seconds).", null),
+    MaxUploadVolumeSize("Storage",  ManagementServer.class, Integer.class, "storage.max.volume.upload.size", "500", "The maximum size for a uploaded volume(in GB).", null),
 	TotalRetries("Storage", AgentManager.class, Integer.class, "total.retries", "4", "The number of times each command sent to a host should be retried in case of failure.", null),
 	StoragePoolMaxWaitSeconds("Storage", ManagementServer.class, Integer.class, "storage.pool.max.waitseconds", "3600", "Timeout (in seconds) to synchronize storage pool operations.", null),
 	StorageTemplateCleanupEnabled("Storage", ManagementServer.class, Boolean.class, "storage.template.cleanup.enabled", "true", "Enable/disable template cleanup activity, only take effect when overall storage cleanup is enabled", null),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index e510435..0d7fc3d 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -185,13 +185,6 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
              _executor.scheduleAtFixedRate(new VmDiskStatsTask(), vmDiskStatsInterval, vmDiskStatsInterval, TimeUnit.SECONDS);
          }
 
-		// -1 means we don't even start this thread to pick up any data.
-		if (volumeStatsInterval > 0) {
-			_executor.scheduleWithFixedDelay(new VolumeCollector(), 15000L, volumeStatsInterval, TimeUnit.MILLISECONDS);
-		} else {
-			s_logger.info("Disabling volume stats collector");
-		}
-
         //Schedule disk stats update task
         _diskStatsUpdateExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("DiskStatsUpdater"));
         String aggregationRange = configs.get("usage.stats.job.aggregation.range");
@@ -548,13 +541,6 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                     if (answer != null && answer.getResult()) {
                         storageStats.put(storeId, (StorageStats)answer);
                         s_logger.trace("HostId: "+storeId+ " Used: " + ((StorageStats)answer).getByteUsed() + " Total Available: " + ((StorageStats)answer).getCapacityBytes());
-                        //Seems like we have dynamically updated the sec. storage as prev. size and the current do not match
-                        if (_storageStats.get(storeId)!=null &&
-                        		_storageStats.get(storeId).getCapacityBytes() != ((StorageStats)answer).getCapacityBytes()){
-                            ImageStoreVO imgStore = _imageStoreDao.findById(storeId);
-	                       	imgStore.setTotalSize(((StorageStats)answer).getCapacityBytes());
-	                        _imageStoreDao.update(storeId, imgStore);
-	                    }
                     }
                 }
                 _storageStats = storageStats;
@@ -603,79 +589,4 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
 	public StorageStats getStoragePoolStats(long id) {
 		return _storagePoolStats.get(id);
 	}
-
-	class VolumeCollector implements Runnable {
-		@Override
-        public void run() {
-			try {
-				List<VolumeVO> volumes = _volsDao.listAll();
-				Map<Long, List<VolumeCommand>> commandsByPool = new HashMap<Long, List<VolumeCommand>>();
-
-				for (VolumeVO volume : volumes) {
-					List<VolumeCommand> commands = commandsByPool.get(volume.getPoolId());
-					if (commands == null) {
-						commands = new ArrayList<VolumeCommand>();
-						commandsByPool.put(volume.getPoolId(), commands);
-					}
-					VolumeCommand vCommand = new VolumeCommand();
-					vCommand.volumeId = volume.getId();
-					vCommand.command = new GetFileStatsCommand(volume);
-					commands.add(vCommand);
-				}
-				ConcurrentHashMap<Long, VolumeStats> volumeStats = new ConcurrentHashMap<Long, VolumeStats>();
-				for (Iterator<Long> iter = commandsByPool.keySet().iterator(); iter.hasNext();) {
-					Long poolId = iter.next();
-					if(poolId != null) {
-						List<VolumeCommand> commandsList = commandsByPool.get(poolId);
-
-						long[] volumeIdArray = new long[commandsList.size()];
-						Commands commands = new Commands(OnError.Continue);
-						for (int i = 0; i < commandsList.size(); i++) {
-							VolumeCommand vCommand = commandsList.get(i);
-							volumeIdArray[i] = vCommand.volumeId;
-							commands.addCommand(vCommand.command);
-						}
-
-			            List<StoragePoolHostVO> poolhosts = _storagePoolHostDao.listByPoolId(poolId);
-			            for(StoragePoolHostVO poolhost : poolhosts) {
-	    					Answer[] answers = _agentMgr.send(poolhost.getHostId(), commands);
-	    					if (answers != null) {
-	    					    long totalBytes = 0L;
-	    						for (int i = 0; i < answers.length; i++) {
-	    							if (answers[i].getResult()) {
-	    							    VolumeStats vStats = (VolumeStats)answers[i];
-	    								volumeStats.put(volumeIdArray[i], vStats);
-	    								totalBytes += vStats.getBytesUsed();
-	    							}
-	    						}
-	    						break;
-	                        }
-			            }
-					}
-				}
-
-				// We replace the existing volumeStats so that it does not grow with no bounds
-				_volumeStats = volumeStats;
-			} catch (AgentUnavailableException e) {
-			    s_logger.debug(e.getMessage());
-			} catch (Throwable t) {
-				s_logger.error("Error trying to retrieve volume stats", t);
-			}
-		}
-	}
-
-	private class VolumeCommand {
-		public long volumeId;
-		public GetFileStatsCommand command;
-	}
-
-	public VolumeStats[] getVolumeStats(long[] ids) {
-		VolumeStats[] stats = new VolumeStats[ids.length];
-		if (volumeStatsInterval > 0) {
-			for (int i = 0; i < ids.length; i++) {
-				stats[i] = _volumeStats.get(ids[i]);
-			}
-		}
-		return stats;
-	}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 387e909..a8a133f 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -37,6 +37,7 @@ ALTER TABLE `cloud`.`load_balancer_vm_map` ADD state VARCHAR(40) NULL COMMENT 's
 
 alter table storage_pool add hypervisor varchar(32);
 alter table storage_pool change storage_provider_id storage_provider_name varchar(255);
+alter table storage_pool change available_bytes used_bytes bigint unsigned;
 -- alter table template_host_ref add state varchar(255);
 -- alter table template_host_ref add update_count bigint unsigned;
 -- alter table template_host_ref add updated datetime;
@@ -88,7 +89,8 @@ CREATE TABLE `cloud`.`image_store` (
   `parent` varchar(255) COMMENT 'parent path for the storage server',
   `created` datetime COMMENT 'date the image store first signed on',
   `removed` datetime COMMENT 'date removed if not null',  
-  `total_size` bigint unsigned COMMENT 'storage statistics',
+  `total_size` bigint unsigned COMMENT 'storage total size statistics',
+  `used_bytes` bigint unsigned COMMENT 'storage available bytes statistics',
   PRIMARY KEY(`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -149,6 +151,7 @@ CREATE TABLE  `cloud`.`template_store_ref` (
   `destroyed` tinyint(1) COMMENT 'indicates whether the template_store entry was destroyed by the user or not',
   `is_copy` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indicates whether this was copied ',
   `update_count` bigint unsigned,
+  `ref_cnt` bigint unsigned,
   `updated` datetime, 
   PRIMARY KEY  (`id`),
 --  CONSTRAINT `fk_template_store_ref__store_id` FOREIGN KEY `fk_template_store_ref__store_id` (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,
@@ -183,6 +186,7 @@ CREATE TABLE  `cloud`.`snapshot_store_ref` (
   `state` varchar(255) NOT NULL,  
   -- `removed` datetime COMMENT 'date removed if not null',  
   `update_count` bigint unsigned,
+  `ref_cnt` bigint unsigned,
   `updated` datetime,   
   PRIMARY KEY  (`id`),
   INDEX `i_snapshot_store_ref__store_id`(`store_id`),
@@ -210,6 +214,7 @@ CREATE TABLE  `cloud`.`volume_store_ref` (
   `state` varchar(255) NOT NULL,  
   `destroyed` tinyint(1) COMMENT 'indicates whether the volume_host entry was destroyed by the user or not',
   `update_count` bigint unsigned,
+  `ref_cnt` bigint unsigned,
   `updated` datetime,   
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_volume_store_ref__store_id` FOREIGN KEY `fk_volume_store_ref__store_id` (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a715eb81/test/pom.xml
----------------------------------------------------------------------
diff --git a/test/pom.xml b/test/pom.xml
index d4b8832..92e6273 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -75,7 +75,7 @@
     </dependencies>
     <build>
         <defaultGoal>compile</defaultGoal>
-        <sourceDirectory>src</sourceDirectory>
+        <sourceDirectory>test</sourceDirectory>
         <testSourceDirectory>test</testSourceDirectory>
         <plugins>
             <plugin>


Mime
View raw message