fix build

This commit is contained in:
Edison Su 2014-03-27 17:37:58 -07:00 committed by Anthony Xu
parent 578d2f62f1
commit 25a6234a5b
9 changed files with 132 additions and 111 deletions

View File

@ -18,10 +18,10 @@ package com.cloud.storage;
import java.util.Date;
import com.cloud.hypervisor.Hypervisor;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.storage.Storage.StoragePoolType;
public interface StoragePool extends Identity, InternalIdentity {
@ -99,13 +99,9 @@ public interface StoragePool extends Identity, InternalIdentity {
Long getPodId();
/**
* @return
*/
String getStorageProviderName();
boolean isInMaintenance();
Hypervisor.HypervisorType getHypervisor();
}

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import com.cloud.agent.api.BackupSnapshotCommand;
import com.cloud.agent.api.to.SwiftTO;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
@ -145,7 +146,14 @@ public class BackupSnapshotCommandTest {
public boolean isInMaintenance() {
// TODO Auto-generated method stub
return false;
};
}
@Override
public Hypervisor.HypervisorType getHypervisor() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
;
};
BackupSnapshotCommand bsc = new BackupSnapshotCommand("http://secondary.Storage.Url", 101L, 102L, 103L, 104L, 105L, "vPath", pool,

View File

@ -32,6 +32,7 @@ import com.cloud.agent.api.CheckNetworkAnswer;
import com.cloud.agent.api.CheckNetworkCommand;
import com.cloud.agent.api.storage.ResizeVolumeCommand;
import com.cloud.agent.api.to.StorageFilerTO;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.storage.Storage;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
@ -184,7 +185,14 @@ public class CheckNetworkAnswerTest {
public boolean isInMaintenance() {
// TODO Auto-generated method stub
return false;
};
}
@Override
public Hypervisor.HypervisorType getHypervisor() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
;
};
Long newSize = 4194304L;

View File

@ -28,6 +28,7 @@ import org.junit.Before;
import org.junit.Test;
import com.cloud.agent.api.SnapshotCommand;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
@ -146,7 +147,14 @@ public class SnapshotCommandTest {
public boolean isInMaintenance() {
// TODO Auto-generated method stub
return false;
};
}
@Override
public Hypervisor.HypervisorType getHypervisor() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
;
};
SnapshotCommand ssc = new SnapshotCommand(pool, "http://secondary.Storage.Url", "420fa39c-4ef1-a83c-fd93-46dc1ff515ae", "snapshotName", 101L, 102L, 103L);

View File

@ -24,8 +24,6 @@ import java.util.Map;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
@ -47,6 +45,7 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
import org.apache.cloudstack.storage.volume.VolumeObject;
import org.apache.log4j.Logger;
import com.cloud.agent.api.to.DataObjectType;
import com.cloud.agent.api.to.DataStoreTO;
@ -391,6 +390,11 @@ public class PrimaryDataStoreImpl implements PrimaryDataStore {
getStatus() == StoragePoolStatus.ErrorInMaintenance || getRemoved() != null;
}
@Override
public HypervisorType getHypervisor() {
return pdsv.getHypervisor();
}
@Override
public String getStorageProviderName() {
return pdsv.getStorageProviderName();

View File

@ -23,7 +23,6 @@ import java.util.List;
import java.util.Set;
import javax.ejb.Local;
import javax.ws.rs.HEAD;
import org.apache.log4j.Logger;
import org.apache.xmlrpc.XmlRpcException;

View File

@ -30,8 +30,6 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.ws.rs.HEAD;
import org.apache.cloudstack.storage.command.AttachAnswer;
import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.AttachPrimaryDataStoreAnswer;
@ -183,8 +181,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
VM.Record vmr = vm.getRecord(conn);
vmNotRunning = vmr.powerState != VmPowerState.RUNNING;
}
catch (CloudRuntimeException ex) {
} catch (CloudRuntimeException ex) {
}
Map<String, String> details = disk.getDetails();
@ -206,8 +203,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
return new AttachAnswer(newDisk);
}
}
else {
} else {
vdi = hypervisorResource.mount(conn, null, null, data.getPath());
}
@ -364,8 +360,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
VM.Record vmr = vm.getRecord(conn);
vmNotRunning = vmr.powerState != VmPowerState.RUNNING;
}
catch (CloudRuntimeException ex) {
} catch (CloudRuntimeException ex) {
}
// if the VM is not running and we're not dealing with managed storage, just return success (nothing to do here)
@ -948,8 +943,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
details.put(DiskTO.CHAP_INITIATOR_SECRET, chapInitiatorSecret);
sr = hypervisorResource.prepareManagedSr(conn, details);
}
else {
} else {
String srName = destDataStoreTo.getUuid();
Set<SR> srs = SR.getByNameLabel(conn, srName);
@ -974,8 +968,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
uuidToReturn = tmplUuid;
tmplVdi.setNameLabel(conn, managedStoragePoolRootVolumeName);
}
else {
} else {
VDI snapshotVdi = tmplVdi.snapshot(conn, new HashMap<String, String>());
uuidToReturn = snapshotVdi.getUuid(conn);

View File

@ -24,7 +24,6 @@ import java.util.UUID;
import javax.inject.Inject;
import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
@ -149,10 +148,13 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
}
@Override
public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) { return false; }
public boolean connectVolumeToHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) {
return false;
}
@Override
public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) {}
public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) {
}
@Override
public long getVolumeSizeIncludingHypervisorSnapshotReserve(Volume volume, StoragePool pool) {

View File

@ -26,10 +26,6 @@ import java.util.Set;
import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.*;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.affinity.AffinityGroupDomainMapVO;
import org.apache.cloudstack.affinity.AffinityGroupResponse;
@ -92,8 +88,15 @@ import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateState;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.query.QueryService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.api.query.dao.AccountJoinDao;
import com.cloud.api.query.dao.AffinityGroupJoinDao;