~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to clc/modules/storage-controller/src/main/java/edu/ucsb/eucalyptus/cloud/ws/BlockStorage.java

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
import org.apache.log4j.Logger;
78
78
import org.apache.tools.ant.util.DateUtils;
 
79
import org.bouncycastle.util.encoders.Base64;
79
80
 
80
81
import com.eucalyptus.bootstrap.Component;
81
82
import com.eucalyptus.bootstrap.SystemBootstrapper;
121
122
import edu.ucsb.eucalyptus.storage.LogicalStorageManager;
122
123
import edu.ucsb.eucalyptus.storage.StorageManager;
123
124
import edu.ucsb.eucalyptus.storage.fs.FileSystemStorageManager;
 
125
import edu.ucsb.eucalyptus.util.EucaSemaphore;
 
126
import edu.ucsb.eucalyptus.util.EucaSemaphoreDirectory;
124
127
 
125
128
public class BlockStorage {
126
129
 
348
351
                                        blockManager.deleteVolume(volumeId);
349
352
                                        volumeStorageManager.deleteObject("", volumeId);
350
353
                                        db.delete(foundVolume);
 
354
                                        EucaSemaphoreDirectory.removeSemaphore(volumeId);
351
355
                                        if(StorageProperties.trackUsageStatistics) { 
352
356
                                                blockStorageStatistics.decrementVolumeCount();
353
357
                                                blockStorageStatistics.updateSpaceUsed(-(foundVolume.getSize() * StorageProperties.GB));
432
436
        //returns snapshots in progress or at the SC
433
437
        public DescribeStorageSnapshotsResponseType DescribeStorageSnapshots( DescribeStorageSnapshotsType request ) throws EucalyptusCloudException {
434
438
                DescribeStorageSnapshotsResponseType reply = ( DescribeStorageSnapshotsResponseType ) request.getReply();
 
439
                checker.transferPendingSnapshots();
435
440
                List<String> snapshotSet = request.getSnapshotSet();
436
441
                ArrayList<SnapshotInfo> snapshotInfos = new ArrayList<SnapshotInfo>();
437
442
                EntityWrapper<SnapshotInfo> db = StorageController.getEntityWrapper();
764
769
 
765
770
                public void run() {
766
771
                        try {
 
772
                                EucaSemaphore semaphore = EucaSemaphoreDirectory.getSolitarySemaphore(volumeId);
 
773
                                try {
 
774
                                        semaphore.acquire();
 
775
                                } catch(InterruptedException ex) {
 
776
                                        throw new EucalyptusCloudException("semaphore could not be acquired");
 
777
                                }
767
778
                                blockManager.createSnapshot(volumeId, snapshotId);
 
779
                                semaphore.release();
768
780
                                List<String> returnValues = blockManager.prepareForTransfer(snapshotId);
769
781
                                snapshotFileName = returnValues.get(0);
770
782
                                transferSnapshot();