replace tab with space, remove debugging messages

This commit is contained in:
Wei Zhou 2013-06-12 09:19:29 +02:00
parent 8da34d2964
commit 0f2c59ad0a
13 changed files with 30 additions and 33 deletions

View File

@ -137,7 +137,7 @@ public class VolumeTO implements InternalIdentity {
public String toString() {
return new StringBuilder("Vol[").append(id).append("|").append(type).append("|").append(path).append("|").append(size).append("]").toString();
}
public void setBytesReadRate(long bytesReadRate) {
this.bytesReadRate = bytesReadRate;
}

View File

@ -52,7 +52,7 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
boolean isCustomized();
void setDiskSize(long diskSize);
void setBytesReadRate(long bytesReadRate);
long getBytesReadRate();

View File

@ -61,7 +61,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
@Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the disk offering. Values are local and shared.")
private String storageType = ServiceOffering.StorageType.shared.toString();
@Parameter(name=ApiConstants.BYTES_READ_RATE, type=CommandType.LONG, required=false, description="bytes read rate of the disk offering")
private Long bytesReadRate;
@ -104,10 +104,9 @@ public class CreateDiskOfferingCmd extends BaseCmd {
public Long getDomainId(){
return domainId;
}
public long getBytesReadRate() {
return bytesReadRate;
//return (bytesReadRate == null) || (bytesReadRate < 0) ? 0 : bytesReadRate;
return (bytesReadRate == null) || (bytesReadRate < 0) ? 0 : bytesReadRate;
}
public long getBytesWriteRate() {
@ -143,7 +142,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
@Override
public void execute(){
DiskOffering offering = _configService.createDiskOffering(this);

View File

@ -57,7 +57,7 @@ public class DiskOfferingResponse extends BaseResponse {
@SerializedName("storagetype") @Param(description="the storage type for this disk offering")
private String storageType;
@SerializedName("diskBytesReadRate") @Param(description="bytes read rate of the disk offering")
private Long bytesReadRate;
@ -176,5 +176,5 @@ public class DiskOfferingResponse extends BaseResponse {
public void setIopsWriteRate(long iopsWriteRate) {
this.iopsWriteRate = iopsWriteRate;
}
}
}

View File

@ -86,7 +86,7 @@ public class ServiceOfferingResponse extends BaseResponse {
@SerializedName(ApiConstants.NETWORKRATE) @Param(description="data transfer rate in megabits per second allowed.")
private Integer networkRate;
@SerializedName("diskBytesReadRate") @Param(description="bytes read rate of the service offering")
private Long bytesReadRate;
@ -260,7 +260,7 @@ public class ServiceOfferingResponse extends BaseResponse {
public void setVolatileVm(boolean isVolatile) {
this.isVolatile = isVolatile;
}
public void setBytesReadRate(long bytesReadRate) {
this.bytesReadRate = bytesReadRate;
}

View File

@ -100,7 +100,7 @@ public class AttachVolumeCommand extends Command {
public String getChainInfo() {
return chainInfo;
}
public void setBytesReadRate(long bytesReadRate) {
this.bytesReadRate = bytesReadRate;
}

View File

@ -99,7 +99,7 @@ public class DiskOfferingVO implements DiskOffering {
@Column(name="sort_key")
int sortKey;
@Column(name="bytes_read_rate")
long bytesReadRate;

View File

@ -3498,7 +3498,7 @@ ServerResource {
}
}
if (volume.getBytesReadRate() > 0)
disk.setBytesReadRate(volume.getBytesReadRate());
if (volume.getBytesWriteRate() > 0)

View File

@ -105,7 +105,7 @@ public class LibvirtDomainXMLParser {
DiskDef.diskBus.valueOf(bus.toUpperCase()));
}
}
NodeList iotune = disk.getElementsByTagName("iotune");
if ((iotune != null) && (iotune.getLength() !=0)) {
String bytesReadRateStr = getTagValue("read_bytes_sec", (Element)iotune.item(0));

View File

@ -589,7 +589,7 @@ public class LibvirtVMDef {
char suffix = this._diskLabel.charAt(this._diskLabel.length() - 1);
return suffix - 'a';
}
public void setBytesReadRate(long bytesReadRate) {
_bytesReadRate = bytesReadRate;
}
@ -649,7 +649,7 @@ public class LibvirtVMDef {
diskBuilder.append(" bus='" + _bus + "'");
}
diskBuilder.append("/>\n");
String libvirtVersion = Script.runSimpleBashScript("virsh version |grep API | awk '{print $4}'");
String qemuVersion = Script.runSimpleBashScript("virsh version |grep hypervisor | awk '{print $4}'");
if ((_deviceType != deviceType.CDROM) && (libvirtVersion != null) && (qemuVersion != null)
@ -675,7 +675,7 @@ public class LibvirtVMDef {
diskBuilder.append("</iotune>\n");
}
}
diskBuilder.append("</disk>\n");
return diskBuilder.toString();
}

View File

@ -2169,8 +2169,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
newDiskOffering.setIopsReadRate(iopsReadRate);
if (iopsWriteRate != null && (iopsWriteRate > 0))
newDiskOffering.setIopsWriteRate(iopsWriteRate);
s_logger.warn("bytesReadRate =" + bytesReadRate);
s_logger.warn("newDiskOffering.getBytesReadRate" + newDiskOffering.getBytesReadRate());
UserContext.current().setEventDetails("Disk offering id=" + newDiskOffering.getId());
DiskOfferingVO offering = _diskOfferingDao.persist(newDiskOffering);

View File

@ -678,7 +678,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
dskCh.setHyperType(hyperType);
final HashSet<StoragePool> avoidPools = new HashSet<StoragePool>(
avoids);

View File

@ -110,28 +110,28 @@
}
},
diskBytesReadRate: {
label: 'label.disk.bytes.read.rate',
label: 'label.disk.bytes.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskBytesWriteRate: {
label: 'label.disk.bytes.write.rate',
label: 'label.disk.bytes.write.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsReadRate: {
label: 'label.disk.iops.read.rate',
label: 'label.disk.iops.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsWriteRate: {
label: 'label.disk.iops.write.rate',
label: 'label.disk.iops.write.rate',
validation: {
required: false, //optional
number: true
@ -586,28 +586,28 @@
}
},
diskBytesReadRate: {
label: 'label.disk.bytes.read.rate',
label: 'label.disk.bytes.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskBytesWriteRate: {
label: 'label.disk.bytes.write.rate',
label: 'label.disk.bytes.write.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsReadRate: {
label: 'label.disk.iops.read.rate',
label: 'label.disk.iops.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsWriteRate: {
label: 'label.disk.iops.write.rate',
label: 'label.disk.iops.write.rate',
validation: {
required: false, //optional
number: true
@ -1043,28 +1043,28 @@
validation: { required: true, number: true }
},
diskBytesReadRate: {
label: 'label.disk.bytes.read.rate',
label: 'label.disk.bytes.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskBytesWriteRate: {
label: 'label.disk.bytes.write.rate',
label: 'label.disk.bytes.write.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsReadRate: {
label: 'label.disk.iops.read.rate',
label: 'label.disk.iops.read.rate',
validation: {
required: false, //optional
number: true
}
},
diskIopsWriteRate: {
label: 'label.disk.iops.write.rate',
label: 'label.disk.iops.write.rate',
validation: {
required: false, //optional
number: true